flvmux: Consider timestamps before segment start to map to segment start
authorSebastian Dröge <sebastian@centricular.com>
Tue, 29 Oct 2024 15:39:02 +0000 (17:39 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 30 Oct 2024 19:55:01 +0000 (19:55 +0000)
Instead of mapping them to running time 0, which is wrong if e.g. the segment
base is not equal to 0.

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

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

index 338e5a52a80828324910f05803d7cb7674cd8d13..b7326f20440e171b24f81815348cca41f73b70cc 100644 (file)
@@ -1674,9 +1674,9 @@ static GstClockTime
 gst_flv_mux_segment_to_running_time (const GstSegment * segment, GstClockTime t)
 {
   /* we can get a dts before the segment, if dts < pts and pts is inside
-   * the segment, so we consider early times as 0 */
+   * the segment, so we consider early times to map to segment start */
   if (t < segment->start)
-    return 0;
+    t = segment->start;
   return gst_segment_to_running_time (segment, GST_FORMAT_TIME, t);
 }