summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-09-09 12:01:51 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-09-09 12:01:51 +0000
commit20f7466550ae57e718600abefd3168d229056e51 (patch)
treedf043f9da70193057ce02966645c396b1fddd664 /libavformat
parentf14a201b32e594d317640b4004dc9a342b6617f8 (diff)
matroskadec: after seeking, skip up to the desired timestamp instead of
the desired stream Originally committed as revision 15282 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 45974235c9..a6a682fad2 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -210,7 +210,7 @@ typedef struct {
/* What to skip before effectively reading a packet. */
int skip_to_keyframe;
- AVStream *skip_to_stream;
+ uint64_t skip_to_timecode;
} MatroskaDemuxContext;
typedef struct {
@@ -1467,7 +1467,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
}
if (matroska->skip_to_keyframe) {
- if (!is_keyframe || st != matroska->skip_to_stream)
+ if (!is_keyframe || timecode < matroska->skip_to_timecode)
return res;
matroska->skip_to_keyframe = 0;
}
@@ -1706,7 +1706,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
- matroska->skip_to_stream = st;
+ matroska->skip_to_timecode = st->index_entries[index].timestamp;
matroska->done = 0;
av_update_cur_dts(s, st, st->index_entries[index].timestamp);
return 0;