summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2023-05-15 19:10:39 +1000
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-16 04:34:16 +0000
commit131d59518eec898007b8ccee6bf0b089dbb44a83 (patch)
tree8692ee21982bc04d54186567d00f0efb4f94bf81
parentad40a9323ea5a811f87a1478fe7ef2646b6163b7 (diff)
downloadgstreamer-131d59518eec898007b8ccee6bf0b089dbb44a83.tar.gz
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>
-rw-r--r--subprojects/gst-plugins-good/gst/multifile/gstsplitmuxpartreader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxpartreader.c b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxpartreader.c
index b38d4b95be..b7d79fb6a7 100644
--- a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxpartreader.c
+++ b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxpartreader.c
@@ -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