mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
matroskademux: V_MS/VFW/FOURCC streams have DTS instead of PTS
When such stream is present demuxer should set DTS on buffers instead of PTS. This is consistent with how VLC and libav/ffmpeg handle VFW streams. Sample file https://s3.amazonaws.com/MatejK/Samples/Matroska-VFW-DTS-Only.mkv https://bugzilla.gnome.org/show_bug.cgi?id=745192
This commit is contained in:
parent
63746c4131
commit
fa283f407f
2 changed files with 13 additions and 1 deletions
|
@ -3467,7 +3467,10 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
|||
goto next_lace;
|
||||
}
|
||||
|
||||
GST_BUFFER_TIMESTAMP (sub) = lace_time;
|
||||
if (!stream->dts_only)
|
||||
GST_BUFFER_PTS (sub) = lace_time;
|
||||
else
|
||||
GST_BUFFER_DTS (sub) = lace_time;
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (lace_time)) {
|
||||
GstClockTime last_stop_end;
|
||||
|
@ -3616,6 +3619,10 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
|||
stream->pos = GST_BUFFER_PTS (sub);
|
||||
if (GST_BUFFER_DURATION_IS_VALID (sub))
|
||||
stream->pos += GST_BUFFER_DURATION (sub);
|
||||
} else if (GST_BUFFER_DTS_IS_VALID (sub)) {
|
||||
stream->pos = GST_BUFFER_DTS (sub);
|
||||
if (GST_BUFFER_DURATION_IS_VALID (sub))
|
||||
stream->pos += GST_BUFFER_DURATION (sub);
|
||||
}
|
||||
|
||||
ret = gst_pad_push (stream->pad, sub);
|
||||
|
@ -4816,6 +4823,8 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
|
|||
memcpy (vids, data, size);
|
||||
}
|
||||
|
||||
context->dts_only = TRUE; /* VFW files only store DTS */
|
||||
|
||||
/* little-endian -> byte-order */
|
||||
vids->size = GUINT32_FROM_LE (vids->size);
|
||||
vids->width = GUINT32_FROM_LE (vids->width);
|
||||
|
|
|
@ -552,6 +552,9 @@ struct _GstMatroskaTrackContext {
|
|||
|
||||
/* any alignment we need our output buffers to have */
|
||||
gint alignment;
|
||||
|
||||
/* for compatibility with VFW files, where timestamp represents DTS */
|
||||
gboolean dts_only;
|
||||
};
|
||||
|
||||
typedef struct _GstMatroskaTrackVideoContext {
|
||||
|
|
Loading…
Reference in a new issue