From 0006f5316af9c283bde6a2e78d9c05c6e2c2c3e1 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Wed, 8 Mar 2023 17:50:47 +0100 Subject: [PATCH] input: es_out: reset buffering on PCR discontinuity If PCR is going back to the past, flush the pipeline and reset the buffering back to avoid waiting for the stream to catch-up with the old reference, and avoid buffering more than what we requested, which would shift the playback more from the live. --- src/input/es_out.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/input/es_out.c b/src/input/es_out.c index 7a00589961..84be03e3df 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -1185,6 +1185,12 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced ) &i_stream_duration, &i_system_duration )) return; + if (i_stream_duration < 0) + { + EsOutChangePosition(out, true); + return; + } + vlc_tick_t i_preroll_duration = 0; if( p_sys->i_preroll_end >= 0 ) i_preroll_duration = __MAX( p_sys->i_preroll_end - i_stream_start, 0 );