Skip to content
Snippets Groups Projects
Commit e6459d2b authored by Thomas Guillem's avatar Thomas Guillem Committed by Steve Lhomme
Browse files

input_clock: finer backward discontinuity detection

This commit fixes a regression from
03d91093 that prevented a RESET_PCR when
the input was more than 300ms late.

Indeed, a PCR going backward must be a discontinuity, there is no need
to compare it with system dates. Comparing with system dates could lead
to a backward system discontinuity, that is generally handled by
increasing the pts-delay and calling RESET_PCR (when
input_clock_Update() return late > 0).
parent a3d8ad98
No related branches found
No related tags found
1 merge request!5861clock: rework discontinuity detection
Pipeline #500714 passed with stage
in 19 minutes and 34 seconds
......@@ -243,7 +243,10 @@ vlc_tick_t input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
vlc_tick_t stream_diff = i_ck_stream - cl->last.stream;
vlc_tick_t system_diff = (i_ck_system - cl->last.system) * cl->rate;
vlc_tick_t diff = stream_diff - system_diff;
if (diff > CR_MAX_GAP || diff < -CR_MAX_GAP)
/* A discontinuity happen if stream timings increase much more than
* system timings or if the stream is going backward. */
if (diff > CR_MAX_GAP || stream_diff < 0)
{
/* Stream discontinuity, for which we haven't received a
* warning from the stream control facilities (dd-edited
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment