hlsdemux2: Increase tolerance for discontinuity detection

A lot of streams will do a poor job of estimating proper duration of fragments
in the playlist, but over several fragments have it correct.

Instead of constantly trying to realign the estimated stream time, allow for a
more realistic tolerance of 3-4 video frames

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
This commit is contained in:
Edward Hervey 2024-04-12 15:45:16 +02:00 committed by GStreamer Marge Bot
parent 8b6e7a018c
commit d2b3262b71

View file

@ -563,7 +563,9 @@ gst_hlsdemux_stream_handle_internal_time (GstHLSDemuxStream * hls_stream,
" difference against expected : %" GST_STIME_FORMAT,
GST_STIME_ARGS (real_stream_time), GST_STIME_ARGS (difference));
if (ABS (difference) > 10 * GST_MSECOND) {
/* We allow a tolerance of 3-4 frames between the estimated and observed
* stream time. */
if (ABS (difference) > 100 * GST_MSECOND) {
GstClockTimeDiff wrong_position_threshold =
hls_stream->current_segment->duration / 2;