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.
This commit is contained in:
Max Kellermann 2009-02-17 22:56:07 +01:00
parent 77db32f8fb
commit 7cea5357e3

View File

@ -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);