Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ee027f23
Commit
ee027f23
authored
Sep 22, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/faad: allocate DecoderBuffer on stack
parent
3ae0d6f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+6
-11
No files found.
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
ee027f23
...
@@ -307,27 +307,24 @@ faad_decoder_decode(NeAACDecHandle decoder, DecoderBuffer *buffer,
...
@@ -307,27 +307,24 @@ faad_decoder_decode(NeAACDecHandle decoder, DecoderBuffer *buffer,
static
std
::
pair
<
bool
,
SignedSongTime
>
static
std
::
pair
<
bool
,
SignedSongTime
>
faad_get_file_time
(
InputStream
&
is
)
faad_get_file_time
(
InputStream
&
is
)
{
{
DecoderBuffer
*
buffer
=
DecoderBuffer
buffer
(
nullptr
,
is
,
new
DecoderBuffer
(
nullptr
,
is
,
FAAD_MIN_STREAMSIZE
*
MAX_CHANNELS
);
FAAD_MIN_STREAMSIZE
*
MAX_CHANNELS
);
auto
duration
=
faad_song_duration
(
buffer
,
is
);
auto
duration
=
faad_song_duration
(
&
buffer
,
is
);
bool
recognized
=
!
duration
.
IsNegative
();
bool
recognized
=
!
duration
.
IsNegative
();
if
(
!
recognized
)
{
if
(
!
recognized
)
{
NeAACDecHandle
decoder
=
faad_decoder_new
();
NeAACDecHandle
decoder
=
faad_decoder_new
();
decoder_buffer_fill
(
buffer
);
decoder_buffer_fill
(
&
buffer
);
AudioFormat
audio_format
;
AudioFormat
audio_format
;
if
(
faad_decoder_init
(
decoder
,
buffer
,
audio_format
,
if
(
faad_decoder_init
(
decoder
,
&
buffer
,
audio_format
,
IgnoreError
()))
IgnoreError
()))
recognized
=
true
;
recognized
=
true
;
NeAACDecClose
(
decoder
);
NeAACDecClose
(
decoder
);
}
}
delete
buffer
;
return
std
::
make_pair
(
recognized
,
duration
);
return
std
::
make_pair
(
recognized
,
duration
);
}
}
...
@@ -414,20 +411,18 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is,
...
@@ -414,20 +411,18 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is,
static
void
static
void
faad_stream_decode
(
Decoder
&
mpd_decoder
,
InputStream
&
is
)
faad_stream_decode
(
Decoder
&
mpd_decoder
,
InputStream
&
is
)
{
{
DecoderBuffer
*
buffer
=
DecoderBuffer
buffer
(
&
mpd_decoder
,
is
,
new
DecoderBuffer
(
&
mpd_decoder
,
is
,
FAAD_MIN_STREAMSIZE
*
MAX_CHANNELS
);
FAAD_MIN_STREAMSIZE
*
MAX_CHANNELS
);
/* create the libfaad decoder */
/* create the libfaad decoder */
const
NeAACDecHandle
decoder
=
faad_decoder_new
();
const
NeAACDecHandle
decoder
=
faad_decoder_new
();
faad_stream_decode
(
mpd_decoder
,
is
,
buffer
,
decoder
);
faad_stream_decode
(
mpd_decoder
,
is
,
&
buffer
,
decoder
);
/* cleanup */
/* cleanup */
NeAACDecClose
(
decoder
);
NeAACDecClose
(
decoder
);
delete
buffer
;
}
}
static
bool
static
bool
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment