[vlc-commits] [Git][videolan/vlc][master] es_out: don't create more than one ES master clock

François Cartegnie (@fcartegnie) gitlab at videolan.org
Fri Jul 9 15:13:51 UTC 2021



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
a6256d3f by Thomas Guillem at 2021-07-09T13:52:49+00:00
es_out: don't create more than one ES master clock

Regression from 800482fbd2a1d3169a920f7b883590a6ff23949a

Fixes #25901

- - - - -


1 changed file:

- src/input/es_out.c


Changes:

=====================================
src/input/es_out.c
=====================================
@@ -75,6 +75,8 @@ typedef struct
     /* Clock for this program */
     input_clock_t    *p_input_clock;
     vlc_clock_main_t *p_main_clock;
+    /* Weak reference to the master ES clock */
+    const vlc_clock_t *p_master_es_clock;
     enum vlc_clock_master_source active_clock_source;
 
     vlc_tick_t i_last_pcr;
@@ -1460,6 +1462,7 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, input_source_t *source, in
     p_pgrm->b_scrambled = false;
     p_pgrm->i_last_pcr = VLC_TICK_INVALID;
     p_pgrm->p_meta = NULL;
+    p_pgrm->p_master_es_clock = NULL;
     p_pgrm->active_clock_source = VLC_CLOCK_MASTER_AUTO;
 
     p_pgrm->p_main_clock = vlc_clock_main_New( p_input->obj.logger );
@@ -2268,10 +2271,11 @@ static void EsOutCreateDecoder( es_out_t *out, es_out_id_t *p_es )
     }
 
     if( p_es->fmt.i_cat != UNKNOWN_ES
-     && p_es->fmt.i_cat == clock_source_cat )
+     && p_es->fmt.i_cat == clock_source_cat
+     && p_es->p_pgrm->p_master_es_clock == NULL )
     {
         p_es->master = true;
-        p_es->p_clock =
+        p_es->p_pgrm->p_master_es_clock = p_es->p_clock =
             vlc_clock_main_CreateMaster( p_es->p_pgrm->p_main_clock,
                                          &clock_cbs, p_es );
     }
@@ -2334,6 +2338,8 @@ static void EsOutDestroyDecoder( es_out_t *out, es_out_id_t *p_es )
 
     vlc_input_decoder_Delete( p_es->p_dec );
     p_es->p_dec = NULL;
+    if( p_es->p_pgrm->p_master_es_clock == p_es->p_clock )
+        p_es->p_pgrm->p_master_es_clock = NULL;
     vlc_clock_Delete( p_es->p_clock );
     p_es->p_clock = NULL;
 



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

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




More information about the vlc-commits mailing list