fix av_seek_frame_generic() so that it doesnt fail if the
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Apr 2007 16:23:44 +0000 (16:23 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Apr 2007 16:23:44 +0000 (16:23 +0000)
requested timestamp is after the last with backward flag

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

libavformat/utils.c

index 59ee8df..ddcf09e 100644 (file)
@@ -1279,7 +1279,7 @@ static int av_seek_frame_generic(AVFormatContext *s,
 
     index = av_index_search_timestamp(st, timestamp, flags);
 
-    if(index < 0){
+    if(index < 0 || index==st->nb_index_entries-1){
         int i;
         AVPacket pkt;