Dont try generic seek if seek request before first index entry and backward.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Feb 2010 23:59:48 +0000 (23:59 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Feb 2010 23:59:48 +0000 (23:59 +0000)
Fixes issue1275

Originally committed as revision 21633 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/utils.c

index eec7a62..58606b0 100644 (file)
@@ -1548,6 +1548,9 @@ static int av_seek_frame_generic(AVFormatContext *s,
 
     index = av_index_search_timestamp(st, timestamp, flags);
 
+    if(index < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
+        return -1;
+
     if(index < 0 || index==st->nb_index_entries-1){
         int i;
         AVPacket pkt;