Commit 87aece00 authored by aurel's avatar aurel

matroskadec: timestamps are dts and not pts in ms vfw compatibility mode

original patch by elupus _at_ ecce _dot_ se


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22184 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b05ebbe8
...@@ -143,6 +143,7 @@ typedef struct { ...@@ -143,6 +143,7 @@ typedef struct {
AVStream *stream; AVStream *stream;
int64_t end_timecode; int64_t end_timecode;
int ms_compat;
} MatroskaTrack; } MatroskaTrack;
typedef struct { typedef struct {
...@@ -1244,6 +1245,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -1244,6 +1245,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC")
&& track->codec_priv.size >= 40 && track->codec_priv.size >= 40
&& track->codec_priv.data != NULL) { && track->codec_priv.data != NULL) {
track->ms_compat = 1;
track->video.fourcc = AV_RL32(track->codec_priv.data + 16); track->video.fourcc = AV_RL32(track->codec_priv.data + 16);
codec_id = ff_codec_get_id(ff_codec_bmp_tags, track->video.fourcc); codec_id = ff_codec_get_id(ff_codec_bmp_tags, track->video.fourcc);
extradata_offset = 40; extradata_offset = 40;
...@@ -1698,6 +1700,9 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, ...@@ -1698,6 +1700,9 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
pkt->flags = is_keyframe; pkt->flags = is_keyframe;
pkt->stream_index = st->index; pkt->stream_index = st->index;
if (track->ms_compat)
pkt->dts = timecode;
else
pkt->pts = timecode; pkt->pts = timecode;
pkt->pos = pos; pkt->pos = pos;
if (st->codec->codec_id == CODEC_ID_TEXT) if (st->codec->codec_id == CODEC_ID_TEXT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment