vlc | branch: master | Thomas Guillem <tho...@gllm.fr> | Mon Mar  8 15:51:03 
2021 +0100| [81ce47e62b1024f41bf52ad6b2d7fab776d470ed] | committer: Thomas 
Guillem

es_out: forward input_clock drift update to the main clock

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

 src/input/es_out.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 22f27b1bc1..726ef53d9e 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1355,6 +1355,13 @@ static void EsOutProgramSelect( es_out_t *out, 
es_out_pgrm_t *p_pgrm )
     }
 }
 
+static void input_clock_OnDriftUpdate( double drift, void *data )
+{
+    es_out_pgrm_t *p_pgrm = data;
+
+    vlc_clock_main_SetInputDrift( p_pgrm->p_main_clock, drift );
+}
+
 /* EsOutAddProgram:
  *  Add a program
  */
@@ -1381,8 +1388,12 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, 
input_source_t *source, in
     p_pgrm->i_last_pcr = VLC_TICK_INVALID;
     p_pgrm->p_meta = NULL;
 
+    static const struct input_clock_cbs cbs = {
+        .on_drift_update = input_clock_OnDriftUpdate,
+    };
+
     p_pgrm->p_master_clock = NULL;
-    p_pgrm->p_input_clock = input_clock_New( p_sys->rate, NULL, NULL );
+    p_pgrm->p_input_clock = input_clock_New( p_sys->rate, &cbs, p_pgrm );
     p_pgrm->p_main_clock = vlc_clock_main_New();
     if( !p_pgrm->p_input_clock || !p_pgrm->p_main_clock )
     {

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to