mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
mpegtsmux: Properly detect backward DTS
There was code to detect backward dts, but the marker min_dts was never set. Setting it enable this feature that prevents potential integer overflow when generating TS. https://bugzilla.gnome.org/show_bug.cgi?id=740575
This commit is contained in:
parent
b23e4452a2
commit
91cbaa5ac7
1 changed files with 7 additions and 2 deletions
|
@ -1067,14 +1067,19 @@ mpegtsmux_clip_inc_running_time (GstCollectPads * pads,
|
|||
GST_LOG_OBJECT (cdata->pad, "buffer dts %" GST_TIME_FORMAT " -> %"
|
||||
GST_TIME_FORMAT " running time",
|
||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), GST_TIME_ARGS (time));
|
||||
if (GST_CLOCK_TIME_IS_VALID (pad_data->min_dts) &&
|
||||
time < pad_data->min_dts) {
|
||||
|
||||
if (!GST_CLOCK_TIME_IS_VALID (pad_data->min_dts))
|
||||
pad_data->min_dts = time;
|
||||
|
||||
if (time < pad_data->min_dts) {
|
||||
/* Ignore DTS going backward */
|
||||
GST_WARNING_OBJECT (cdata->pad, "ignoring DTS going backward");
|
||||
time = pad_data->min_dts;
|
||||
}
|
||||
|
||||
*outbuf = gst_buffer_make_writable (buf);
|
||||
GST_BUFFER_DTS (*outbuf) = time;
|
||||
pad_data->min_dts = time;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue