From 023c67e166b552b4a13b8d6b226960ca8ee7f198 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 7 Aug 2022 14:23:04 +1000 Subject: [PATCH] hlsdemux: Consider starting stream time in presentation offset When calculating the presentation offset for CMAF input in live playback, subtract the stream_time of the fragment from the calculated presentation offset, so that the first fragment is played at running time zero. Part-of: --- .../gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c index 0cf7a346bc..6e45c34b0f 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c @@ -1303,7 +1303,7 @@ gst_hlsdemux_handle_internal_time (GstHLSDemux * demux, g_assert (current_stream_time >= 0); if (hls_stream->parser_type == GST_HLS_PARSER_ISOBMFF) - hls_stream->presentation_offset = internal_time; + hls_stream->presentation_offset = internal_time - current_stream_time; map->stream_time = current_stream_time; map->internal_time = internal_time;