flvmux: Consider timestamps before segment start to map to segment start

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/7780>
This commit is contained in:
Sebastian Dröge 2024-10-29 17:39:02 +02:00 committed by GStreamer Marge Bot
parent 356aca593d
commit 4ea16ff146

View file

@ -1672,9 +1672,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);
}