mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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.
This commit is contained in:
parent
8006979109
commit
b7f95d64f8
1 changed files with 6 additions and 3 deletions
|
@ -665,6 +665,7 @@ mpegts_packetizer_new (void)
|
||||||
void
|
void
|
||||||
mpegts_packetizer_push (MpegTSPacketizer2 * packetizer, GstBuffer * buffer)
|
mpegts_packetizer_push (MpegTSPacketizer2 * packetizer, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
|
GstClockTime ts;
|
||||||
if (G_UNLIKELY (packetizer->empty)) {
|
if (G_UNLIKELY (packetizer->empty)) {
|
||||||
packetizer->empty = FALSE;
|
packetizer->empty = FALSE;
|
||||||
packetizer->offset = GST_BUFFER_OFFSET (buffer);
|
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),
|
G_GUINT64_FORMAT, gst_buffer_get_size (buffer),
|
||||||
GST_BUFFER_OFFSET (buffer));
|
GST_BUFFER_OFFSET (buffer));
|
||||||
gst_adapter_push (packetizer->adapter, buffer);
|
gst_adapter_push (packetizer->adapter, buffer);
|
||||||
/* If buffer timestamp is valid, store it */
|
/* If the buffer has a valid timestamp, store it - preferring DTS,
|
||||||
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)))
|
* which is where upstream arrival times should be stored */
|
||||||
packetizer->last_in_time = GST_BUFFER_TIMESTAMP (buffer);
|
ts = GST_BUFFER_DTS_OR_PTS (buffer);
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (ts))
|
||||||
|
packetizer->last_in_time = ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue