summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2015-06-15 10:08:57 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2015-06-15 10:10:40 -0400
commit6bf6429bc1dc1c787a652228ea86c9e8ca466fa5 (patch)
tree805a9990abf8962b67ad0c47aa8ca53fa5355480
parent890de823e632fbf2380eac77ab27f9964c7a61d0 (diff)
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.
-rw-r--r--gst/mpegtsmux/mpegtsmux.c16
-rw-r--r--gst/mpegtsmux/mpegtsmux.h3
2 files changed, 6 insertions, 13 deletions
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 208c631df..71e2cd881 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -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;
}
diff --git a/gst/mpegtsmux/mpegtsmux.h b/gst/mpegtsmux/mpegtsmux.h
index daceb25bc..f54342d42 100644
--- a/gst/mpegtsmux/mpegtsmux.h
+++ b/gst/mpegtsmux/mpegtsmux.h
@@ -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;