aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-07 21:34:35 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-07 21:48:48 +0100
commit7c00d853a65884870e2a7a916197d87c125ed630 (patch)
treed724c6ef53280e388ab0807c2fc88355c16dfe81
parentc0a4871c1687279c5fbe6d5d7f475a393c645b05 (diff)
downloadffmpeg-7c00d853a65884870e2a7a916197d87c125ed630.tar.gz
matroskadec: support seek to non keyframes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/matroskadec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 1a15558fad..294e38c33b 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2418,9 +2418,14 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
matroska->current_id = 0;
- st->skip_to_keyframe =
- matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
- matroska->skip_to_timecode = st->index_entries[index].timestamp;
+ if (flags & AVSEEK_FLAG_ANY) {
+ st->skip_to_keyframe = 0;
+ matroska->skip_to_timecode = timestamp;
+ } else {
+ st->skip_to_keyframe = 1;
+ matroska->skip_to_timecode = st->index_entries[index].timestamp;
+ }
+ matroska->skip_to_keyframe = 1;
matroska->done = 0;
matroska->num_levels = 0;
ff_update_cur_dts(s, st, st->index_entries[index].timestamp);