diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-19 13:09:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-20 01:58:18 +0200 |
commit | a7e4342fc1a0e962b829a9a194d034fa38590951 (patch) | |
tree | 4a82d3719514d2c29004f246a431326c0dc50f9e | |
parent | 6c0f5172f6735c0b185721ff0f456f53ef7ac677 (diff) | |
download | ffmpeg-a7e4342fc1a0e962b829a9a194d034fa38590951.tar.gz |
avidec: consider non video to contain only keyframes when seeking.
Fixes Ticket271
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avidec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 72ea9e2944..80620dadba 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1355,7 +1355,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp index = av_index_search_timestamp( st2, av_rescale_q(timestamp, st->time_base, st2->time_base) * FFMAX(ast2->sample_size, 1), - flags | AVSEEK_FLAG_BACKWARD); + flags | AVSEEK_FLAG_BACKWARD | (st2->codec->codec_type != AVMEDIA_TYPE_VIDEO ? AVSEEK_FLAG_ANY : 0)); if(index<0) index=0; ast2->seek_pos= st2->index_entries[index].pos; @@ -1371,7 +1371,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp index = av_index_search_timestamp( st2, av_rescale_q(timestamp, st->time_base, st2->time_base) * FFMAX(ast2->sample_size, 1), - flags | AVSEEK_FLAG_BACKWARD); + flags | AVSEEK_FLAG_BACKWARD | (st2->codec->codec_type != AVMEDIA_TYPE_VIDEO ? AVSEEK_FLAG_ANY : 0)); if(index<0) index=0; while(index>0 && st2->index_entries[index-1].pos >= pos_min) |