[vlc-commits] [Git][videolan/vlc][master] input_clock: finer backward discontinuity detection

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Aug 8 17:53:38 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e6459d2b by Thomas Guillem at 2024-08-08T17:05:12+00:00
input_clock: finer backward discontinuity detection

This commit fixes a regression from
03d91093af3fb6f1bd913715bc4656b87ead8f09 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).

- - - - -


1 changed file:

- src/clock/input_clock.c


Changes:

=====================================
src/clock/input_clock.c
=====================================
@@ -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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e6459d2b700e1509190b3fb3035a11f88a8d8abd

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e6459d2b700e1509190b3fb3035a11f88a8d8abd
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list