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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3680>
This commit is contained in:
Jan Schmidt 2022-08-07 14:23:04 +10:00 committed by GStreamer Marge Bot
parent b7c0e8bc84
commit 023c67e166

View 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;