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
da599e3f
Commit
da599e3f
authored
Jul 12, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/faad: split faad_stream_decode()
Eliminate duplicate cleanup code.
parent
4c7b0b93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+16
-10
No files found.
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
da599e3f
...
...
@@ -360,17 +360,11 @@ faad_get_file_time(InputStream &is)
}
static
void
faad_stream_decode
(
Decoder
&
mpd_decoder
,
InputStream
&
is
)
faad_stream_decode
(
Decoder
&
mpd_decoder
,
InputStream
&
is
,
DecoderBuffer
*
buffer
,
const
NeAACDecHandle
decoder
)
{
DecoderBuffer
*
buffer
=
decoder_buffer_new
(
&
mpd_decoder
,
is
,
FAAD_MIN_STREAMSIZE
*
MAX_CHANNELS
);
const
float
total_time
=
faad_song_duration
(
buffer
,
is
);
/* create the libfaad decoder */
const
NeAACDecHandle
decoder
=
faad_decoder_new
();
while
(
!
decoder_buffer_is_full
(
buffer
)
&&
!
is
.
LockIsEOF
()
&&
decoder_get_command
(
mpd_decoder
)
==
DecoderCommand
::
NONE
)
{
adts_find_frame
(
buffer
);
...
...
@@ -383,8 +377,6 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is)
AudioFormat
audio_format
;
if
(
!
faad_decoder_init
(
decoder
,
buffer
,
audio_format
,
error
))
{
LogError
(
error
);
NeAACDecClose
(
decoder
);
decoder_buffer_free
(
buffer
);
return
;
}
...
...
@@ -448,6 +440,20 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is)
(
size_t
)
frame_info
.
samples
*
2
,
bit_rate
);
}
while
(
cmd
!=
DecoderCommand
::
STOP
);
}
static
void
faad_stream_decode
(
Decoder
&
mpd_decoder
,
InputStream
&
is
)
{
DecoderBuffer
*
buffer
=
decoder_buffer_new
(
&
mpd_decoder
,
is
,
FAAD_MIN_STREAMSIZE
*
MAX_CHANNELS
);
/* create the libfaad decoder */
const
NeAACDecHandle
decoder
=
faad_decoder_new
();
faad_stream_decode
(
mpd_decoder
,
is
,
buffer
,
decoder
);
/* cleanup */
...
...
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