hlsdemux: Consider starting stream time in presentation offset
authorJan Schmidt <jan@centricular.com>
Sun, 7 Aug 2022 04:23:04 +0000 (14:23 +1000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 5 Jan 2023 07:08:16 +0000 (07:08 +0000)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3680>

subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c

index 0cf7a34..6e45c34 100644 (file)
@@ -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;