mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-08 12:51:21 +00:00
mpegtsmux: Remove redundant min_dts
After few iteration, this variable became the same as dts. It's not the min as the name says, but the dts of the current buffer. Simply remove and place with dts. Also move the debug trace to actually print the signed version of the running-time dts.
This commit is contained in:
parent
890de823e6
commit
6bf6429bc1
2 changed files with 6 additions and 13 deletions
|
@ -331,7 +331,6 @@ static void
|
|||
mpegtsmux_pad_reset (MpegTsPadData * pad_data)
|
||||
{
|
||||
pad_data->pid = 0;
|
||||
pad_data->min_dts = GST_CLOCK_STIME_NONE;
|
||||
pad_data->dts = GST_CLOCK_STIME_NONE;
|
||||
pad_data->prog_id = -1;
|
||||
#if 0
|
||||
|
@ -1066,22 +1065,19 @@ mpegtsmux_clip_inc_running_time (GstCollectPads * pads,
|
|||
sign = gst_segment_to_running_time_full (&cdata->segment, GST_FORMAT_TIME,
|
||||
time, &time);
|
||||
|
||||
GST_LOG_OBJECT (cdata->pad, "buffer dts %" GST_TIME_FORMAT " -> %"
|
||||
GST_STIME_FORMAT " running time", GST_STIME_ARGS (GST_BUFFER_DTS (buf)),
|
||||
GST_STIME_ARGS (time));
|
||||
|
||||
if (sign > 0)
|
||||
dts = (gint64) time;
|
||||
else
|
||||
dts = -((gint64) time);
|
||||
|
||||
if (!GST_CLOCK_TIME_IS_VALID (pad_data->min_dts))
|
||||
pad_data->min_dts = dts;
|
||||
GST_LOG_OBJECT (cdata->pad, "buffer dts %" GST_TIME_FORMAT " -> %"
|
||||
GST_STIME_FORMAT " running time", GST_TIME_ARGS (GST_BUFFER_DTS (buf)),
|
||||
GST_STIME_ARGS (dts));
|
||||
|
||||
if (dts < pad_data->min_dts) {
|
||||
if (GST_CLOCK_STIME_IS_VALID (pad_data->dts) && dts < pad_data->dts) {
|
||||
/* Ignore DTS going backward */
|
||||
GST_WARNING_OBJECT (cdata->pad, "ignoring DTS going backward");
|
||||
dts = pad_data->min_dts;
|
||||
dts = pad_data->dts;
|
||||
}
|
||||
|
||||
*outbuf = gst_buffer_make_writable (buf);
|
||||
|
@ -1090,7 +1086,7 @@ mpegtsmux_clip_inc_running_time (GstCollectPads * pads,
|
|||
else
|
||||
GST_BUFFER_DTS (*outbuf) = GST_CLOCK_TIME_NONE;
|
||||
|
||||
pad_data->dts = pad_data->min_dts = dts;
|
||||
pad_data->dts = dts;
|
||||
} else {
|
||||
pad_data->dts = GST_CLOCK_STIME_NONE;
|
||||
}
|
||||
|
|
|
@ -182,9 +182,6 @@ struct MpegTsPadData {
|
|||
gint pid;
|
||||
TsMuxStream *stream;
|
||||
|
||||
/* most recent valid DTS for this stream */
|
||||
gint64 min_dts;
|
||||
|
||||
/* most recent DTS */
|
||||
gint64 dts;
|
||||
|
||||
|
|
Loading…
Reference in a new issue