[vlc-commits] [Git][videolan/vlc][master] 2 commits: es_out: factorize jitter update when changing delay

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Mar 10 05:51:30 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
44c14941 by Thomas Guillem at 2023-03-10T05:36:25+00:00
es_out: factorize jitter update when changing delay

- - - - -
0d817af3 by Thomas Guillem at 2023-03-10T05:36:25+00:00
es_out: add missing jitter update when creating a decoder

This fixes the input not being able to catch up with the delay when
setting it from start (via --audio-desync or --sub-delay). This was
noticeable with --clock-master=input.

- - - - -


1 changed file:

- src/input/es_out.c


Changes:

=====================================
src/input/es_out.c
=====================================
@@ -708,6 +708,15 @@ static bool EsOutDecodersIsEmpty( es_out_t *out )
     return true;
 }
 
+static void EsOutUpdateDelayJitter(es_out_t *out)
+{
+    es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
+
+    /* Update the clock pts delay only if the extra tracks delay changed */
+    EsOutPrivControlLocked(out, ES_OUT_PRIV_SET_JITTER, p_sys->i_pts_delay,
+                           p_sys->i_pts_jitter, p_sys->i_cr_average);
+}
+
 static void EsOutSetEsDelay(es_out_t *out, es_out_id_t *es, vlc_tick_t delay)
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
@@ -718,9 +727,7 @@ static void EsOutSetEsDelay(es_out_t *out, es_out_id_t *es, vlc_tick_t delay)
 
     EsOutDecoderChangeDelay(out, es);
 
-    /* Update the clock pts delay only if the extra tracks delay changed */
-    EsOutPrivControlLocked(out, ES_OUT_PRIV_SET_JITTER, p_sys->i_pts_delay,
-                           p_sys->i_pts_jitter, p_sys->i_cr_average);
+    EsOutUpdateDelayJitter(out);
 }
 
 static void EsOutSetDelay( es_out_t *out, int i_cat, vlc_tick_t i_delay )
@@ -736,9 +743,7 @@ static void EsOutSetDelay( es_out_t *out, int i_cat, vlc_tick_t i_delay )
     foreach_es_then_es_slaves(es)
         EsOutDecoderChangeDelay(out, es);
 
-    /* Update the clock pts delay only if the extra tracks delay changed */
-    EsOutPrivControlLocked(out, ES_OUT_PRIV_SET_JITTER, p_sys->i_pts_delay,
-                           p_sys->i_pts_jitter, p_sys->i_cr_average);
+    EsOutUpdateDelayJitter(out);
 }
 
 static int EsOutSetRecord(  es_out_t *out, bool b_record, const char *dir_path )
@@ -2329,6 +2334,8 @@ static void EsOutCreateDecoder( es_out_t *out, es_out_id_t *p_es )
     p_es->p_dec = dec;
 
     EsOutDecoderChangeDelay( out, p_es );
+
+    EsOutUpdateDelayJitter(out);
 }
 static void EsOutDestroyDecoder( es_out_t *out, es_out_id_t *p_es )
 {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a4ac04bf17064f9a21bcc6e651e8892f09f0ca81...0d817af380d9eb193bccea17b47fdcbe7ffc7e4b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a4ac04bf17064f9a21bcc6e651e8892f09f0ca81...0d817af380d9eb193bccea17b47fdcbe7ffc7e4b
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