splitmuxsrc: Make PTS contiguous by preference

Make splitmuxsrc deal better with stream reordering by
making the largest observed PTS contiguous in the
next fragment. Previously, it selected DTS, but then
aligned that with the segment start of the next fragment,
which holds PTS values - leading to glitches in
streams that don't have PTS = DTS at the start.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4637>
This commit is contained in:
Jan Schmidt 2023-05-15 19:10:39 +10:00 committed by GStreamer Marge Bot
parent ad40a9323e
commit 131d59518e

View file

@ -158,12 +158,12 @@ handle_buffer_measuring (GstSplitMuxPartReader * reader,
* not to generate output timestamps */
/* Update the stored max duration on the pad,
* always preferring making DTS contiguous
* always preferring making reordered PTS contiguous
* where possible */
if (GST_BUFFER_DTS_IS_VALID (buf))
ts = GST_BUFFER_DTS (buf) + offset;
else if (GST_BUFFER_PTS_IS_VALID (buf))
if (GST_BUFFER_PTS_IS_VALID (buf))
ts = GST_BUFFER_PTS (buf) + offset;
else if (GST_BUFFER_DTS_IS_VALID (buf))
ts = GST_BUFFER_DTS (buf) + offset;
GST_DEBUG_OBJECT (reader, "Pad %" GST_PTR_FORMAT
" incoming DTS %" GST_TIME_FORMAT