[vlc-commits] es_out: change clocks allocation order

Thomas Guillem git at videolan.org
Mon Apr 12 07:49:39 UTC 2021


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar 31 15:52:18 2021 +0200| [658948229ce841ddd508b3c66a16061d5d502ffd] | committer: Thomas Guillem

es_out: change clocks allocation order

No functional changes.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=658948229ce841ddd508b3c66a16061d5d502ffd
---

 src/input/es_out.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 28f11a2f20..7dbb5d9a00 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1411,15 +1411,22 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, input_source_t *source, in
     p_pgrm->p_meta = NULL;
 
     p_pgrm->p_master_clock = NULL;
-    p_pgrm->p_input_clock = input_clock_New( NULL, p_sys->rate );
+
     p_pgrm->p_main_clock = vlc_clock_main_New();
-    if( !p_pgrm->p_input_clock || !p_pgrm->p_main_clock )
+    if( !p_pgrm->p_main_clock )
     {
-        if( p_pgrm->p_input_clock )
-            input_clock_Delete( p_pgrm->p_input_clock );
         free( p_pgrm );
         return NULL;
     }
+
+    p_pgrm->p_input_clock = input_clock_New( NULL, p_sys->rate );
+    if( !p_pgrm->p_input_clock )
+    {
+        vlc_clock_main_Delete( p_pgrm->p_main_clock );
+        free( p_pgrm );
+        return NULL;
+    }
+
     if( p_sys->b_paused )
         input_clock_ChangePause( p_pgrm->p_input_clock, p_sys->b_paused, p_sys->i_pause_date );
     const vlc_tick_t pts_delay = p_sys->i_pts_delay + p_sys->i_pts_jitter



More information about the vlc-commits mailing list