From e42b152037d5d7697bb6775d9fb72c8b051d0d9c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Jul 2014 01:51:39 +0200 Subject: decoder/faad: eliminate the adts_find_frame() loop This loop is completely unnecessary. We just need to find the first ADTS frame and feed it into NeAACDecInit(). --- src/decoder/plugins/FaadDecoderPlugin.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/plugins/FaadDecoderPlugin.cxx b/src/decoder/plugins/FaadDecoderPlugin.cxx index 1fdc7def0..47dbc7c66 100644 --- a/src/decoder/plugins/FaadDecoderPlugin.cxx +++ b/src/decoder/plugins/FaadDecoderPlugin.cxx @@ -365,11 +365,8 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is, { const float total_time = faad_song_duration(buffer, is); - while (!decoder_buffer_is_full(buffer) && !is.LockIsEOF() && - decoder_get_command(mpd_decoder) == DecoderCommand::NONE) { - adts_find_frame(buffer); - decoder_buffer_fill(buffer); - } + if (adts_find_frame(buffer) == 0) + return; /* initialize it */ -- cgit v1.2.3