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
This commit is contained in:
Edward Hervey 2024-04-12 15:45:16 +02:00
parent 2d6d7d4c47
commit c7ee3d066b

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;