[vlc-devel] [PATCH 06/17] es_out: send the normal_time

Thomas Guillem thomas at gllm.fr
Tue Mar 9 15:15:35 UTC 2021


It's calculated from the matching_time sent by the demux.
---
 src/input/es_out.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 07af21299c8..1ec6072b78f 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3182,6 +3182,7 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
         es_out_pgrm_t *p_pgrm = NULL;
         int            i_group = 0;
         vlc_tick_t     i_pcr;
+        vlc_tick_t     i_matching_time;
 
         /* Search program */
         if( i_query == ES_OUT_SET_PCR )
@@ -3204,6 +3205,7 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
             msg_Err( p_sys->p_input, "Invalid PCR value in ES_OUT_SET_(GROUP_)PCR !" );
             return VLC_EGENERIC;
         }
+        i_matching_time = va_arg( args, vlc_tick_t );
 
         p_pgrm->i_last_pcr = i_pcr;
 
@@ -3218,6 +3220,9 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
                             b_extra_buffering_allowed,
                             i_pcr, vlc_tick_now() );
 
+        if( i_matching_time != VLC_TICK_INVALID )
+            vlc_clock_main_SetInputNormalTime( p_pgrm->p_main_clock, i_pcr - i_matching_time );
+
         if( !p_sys->p_pgrm )
             return VLC_SUCCESS;
 
-- 
2.30.0



More information about the vlc-devel mailing list