From b80b3b1199d2e6d59fb5ab677610eb98bf6a53ff Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Tue, 5 Nov 2013 12:10:22 -0800 Subject: [PATCH] Fixed MP3 seeking when resync occurs before the first packet --- Frameworks/FFMPEG/ffmpeg-minimal/libavformat/mp3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/FFMPEG/ffmpeg-minimal/libavformat/mp3dec.c b/Frameworks/FFMPEG/ffmpeg-minimal/libavformat/mp3dec.c index 6edc4a417..f26c1f138 100644 --- a/Frameworks/FFMPEG/ffmpeg-minimal/libavformat/mp3dec.c +++ b/Frameworks/FFMPEG/ffmpeg-minimal/libavformat/mp3dec.c @@ -444,7 +444,7 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, skipped += spf; avio_skip(s->pb, c.frame_size); - } while ( skipped < timestamp_samples && avio_tell(s->pb) < mp3->filesize ); + } while ( (!timestamp_samples || skipped < timestamp_samples) && avio_tell(s->pb) < mp3->filesize ); st->skip_samples = timestamp_samples - skipped + skip_extra; }