Commit b7f95d64 authored by Jan Schmidt's avatar Jan Schmidt

tsdemux: Skew correction should use the upstream DTS

The MPEG-TS packetiser should use the upstream DTS for
skew correction when running in that mode, as the DTS
carries the upstream arrival time. The PTS (if it's
set at all) is less useful, and can be invalid.
parent 80069791
Pipeline #18920 passed with stages
in 17 minutes and 50 seconds
......@@ -665,6 +665,7 @@ mpegts_packetizer_new (void)
mpegts_packetizer_push (MpegTSPacketizer2 * packetizer, GstBuffer * buffer)
GstClockTime ts;
if (G_UNLIKELY (packetizer->empty)) {
packetizer->empty = FALSE;
packetizer->offset = GST_BUFFER_OFFSET (buffer);
......@@ -674,9 +675,11 @@ mpegts_packetizer_push (MpegTSPacketizer2 * packetizer, GstBuffer * buffer)
G_GUINT64_FORMAT, gst_buffer_get_size (buffer),
gst_adapter_push (packetizer->adapter, buffer);
/* If buffer timestamp is valid, store it */
packetizer->last_in_time = GST_BUFFER_TIMESTAMP (buffer);
/* If the buffer has a valid timestamp, store it - preferring DTS,
* which is where upstream arrival times should be stored */
ts = GST_BUFFER_DTS_OR_PTS (buffer);
packetizer->last_in_time = ts;
static void
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