diff options
author | Max Kellermann <max@duempel.org> | 2009-02-17 22:56:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-17 22:56:07 +0100 |
commit | 7cea5357e3b92264314fde86cf6d57e2f3176792 (patch) | |
tree | 44def1403a6ae576267f009a19de51424ed9270d /src/decoder | |
parent | 77db32f8fb827eba8cacf2e4500521f3b313601d (diff) | |
download | mpd-7cea5357e3b92264314fde86cf6d57e2f3176792.tar.gz mpd-7cea5357e3b92264314fde86cf6d57e2f3176792.tar.xz mpd-7cea5357e3b92264314fde86cf6d57e2f3176792.zip |
faad: check the result of adts_find_frame()
Instead of checking if the buffer is empty after adts_find_frame(),
check adts_find_frame()'s return value. This is more robust.
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/faad_plugin.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/decoder/faad_plugin.c b/src/decoder/faad_plugin.c index 2db6b99b3..ee05db4d5 100644 --- a/src/decoder/faad_plugin.c +++ b/src/decoder/faad_plugin.c @@ -392,10 +392,8 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is) file_time = 0.0; do { - adts_find_frame(&buffer); - faad_buffer_fill(&buffer); - - if (buffer.length == 0) + size_t frame_size = adts_find_frame(&buffer); + if (frame_size == 0) break; decoded = faad_decoder_decode(decoder, &buffer, &frame_info); |