aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2010-03-03 21:46:43 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-03-03 21:46:43 +0000
commit3e93c8ed146fcf16065a98dd3f7eee27022684ae (patch)
treeb10935d12b6142bf42fe2aa5a862571413eb48e3
parent3d9137c8830bce3521a2249c02e2f96aefd7742c (diff)
downloadffmpeg-3e93c8ed146fcf16065a98dd3f7eee27022684ae.tar.gz
matroskadec: timestamps are dts and not pts in ms vfw compatibility mode
original patch by elupus _at_ ecce _dot_ se Originally committed as revision 22184 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/matroskadec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index de896d7575..8b4cc5ef61 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -143,6 +143,7 @@ typedef struct {
AVStream *stream;
int64_t end_timecode;
+ int ms_compat;
} MatroskaTrack;
typedef struct {
@@ -1244,6 +1245,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC")
&& track->codec_priv.size >= 40
&& track->codec_priv.data != NULL) {
+ track->ms_compat = 1;
track->video.fourcc = AV_RL32(track->codec_priv.data + 16);
codec_id = ff_codec_get_id(ff_codec_bmp_tags, track->video.fourcc);
extradata_offset = 40;
@@ -1698,6 +1700,9 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
pkt->flags = is_keyframe;
pkt->stream_index = st->index;
+ if (track->ms_compat)
+ pkt->dts = timecode;
+ else
pkt->pts = timecode;
pkt->pos = pos;
if (st->codec->codec_id == CODEC_ID_TEXT)