diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-02-03 23:59:48 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-02-03 23:59:48 +0000 |
commit | 8c3b161e9ea74013b38ea1985ffda07473978d16 (patch) | |
tree | a8fad23f478d68165d7d776d2299cf078d950b7b | |
parent | 82e5f86bd503db42999df3c0a90efeef8e3dda20 (diff) | |
download | ffmpeg-8c3b161e9ea74013b38ea1985ffda07473978d16.tar.gz |
Dont try generic seek if seek request before first index entry and backward.
Fixes issue1275
Originally committed as revision 21633 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index eec7a62f6b..58606b0da7 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; |