flvmux: Mux timestampless buffers immediately
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Mon, 21 Sep 2020 14:48:38 +0000 (16:48 +0200)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Fri, 15 Nov 2024 17:45:30 +0000 (17:45 +0000)
Instead of leaving them queued indefinitely, or until we're timing out
and it's the only buffer queued.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7902>

subprojects/gst-plugins-good/gst/flv/gstflvmux.c

index 638ba5592793ec60f93f8188477c3046e57e67fb..69a34bbc78d1e0098c72b9e2f8c2bbbe2d5de12c 100644 (file)
@@ -2001,12 +2001,16 @@ gst_flv_mux_find_best_pad (GstAggregator * aggregator, GstClockTime * ts,
           break;
         }
 
-        if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS_OR_PTS (buffer))) {
-          t = gst_flv_mux_segment_to_running_time (&apad->segment,
-              GST_BUFFER_DTS_OR_PTS (buffer));
-        }
+        t = gst_flv_mux_segment_to_running_time (&apad->segment,
+            GST_BUFFER_DTS_OR_PTS (buffer));
 
-        if (!GST_CLOCK_TIME_IS_VALID (best_ts) ||
+        if (!GST_CLOCK_TIME_IS_VALID (t)) {
+          GST_WARNING_OBJECT (apad, "Buffer has no timestamp: %" GST_PTR_FORMAT,
+              buffer);
+          gst_object_replace ((GstObject **) & best, GST_OBJECT (apad));
+          best_ts = GST_CLOCK_TIME_NONE;
+          done = TRUE;
+        } else if (!GST_CLOCK_TIME_IS_VALID (best_ts) ||
             (GST_CLOCK_TIME_IS_VALID (t) && t < best_ts)) {
           gst_object_replace ((GstObject **) & best, GST_OBJECT (apad));
           best_ts = t;