[vlc-devel] [PATCH 10/17] input: remove unused normal_time handling

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


---
 include/vlc_demux.h          |  2 --
 src/input/demux.c            |  2 --
 src/input/es_out.c           |  9 ++-------
 src/input/es_out.h           |  7 +++----
 src/input/es_out_timeshift.c |  4 ----
 src/input/event.h            |  3 +--
 src/input/input.c            | 11 ++---------
 src/input/input_internal.h   |  1 -
 8 files changed, 8 insertions(+), 31 deletions(-)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 6d6befa01ba..1cd436d50a1 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -187,8 +187,6 @@ enum demux_query_e
     DEMUX_GET_LENGTH,           /* arg1= vlc_tick_t *   res=    */
     DEMUX_GET_TIME,             /* arg1= vlc_tick_t *   res=    */
     DEMUX_SET_TIME,             /* arg1= vlc_tick_t arg2= bool b_precise   res=can fail    */
-    /* Normal or original time, used mainly by the ts module */
-    DEMUX_GET_NORMAL_TIME,      /* arg1= vlc_tick_t *   res= can fail, in that case VLC_TICK_0 will be used as NORMAL_TIME */
 
     /**
      * \todo Document
diff --git a/src/input/demux.c b/src/input/demux.c
index a1e081b9577..5a4fa78c0e6 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -301,8 +301,6 @@ int demux_vaControlHelper( stream_t *s,
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;
-        case DEMUX_GET_NORMAL_TIME:
-            return VLC_EGENERIC;
 
         case DEMUX_SET_POSITION:
             f = va_arg( args, double );
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 1ec6072b78f..8618e725c06 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3698,7 +3698,6 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
     {
         double f_position = va_arg( args, double );
         vlc_tick_t i_time = va_arg( args, vlc_tick_t );
-        vlc_tick_t i_normal_time = va_arg( args, vlc_tick_t );
         vlc_tick_t i_length = va_arg( args, vlc_tick_t );
 
         if( !p_sys->b_buffering )
@@ -3724,14 +3723,10 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
             if( f_position < 0 )
                 f_position = 0;
 
-            assert( i_normal_time >= VLC_TICK_0 );
-
-            input_SendEventTimes( p_sys->p_input, f_position, i_time,
-                                  i_normal_time, i_length );
+            input_SendEventTimes( p_sys->p_input, f_position, i_time, i_length );
         }
         else
-            input_SendEventTimes( p_sys->p_input, 0.0, VLC_TICK_INVALID,
-                                  i_normal_time, i_length );
+            input_SendEventTimes( p_sys->p_input, 0.0, VLC_TICK_INVALID, i_length );
         return VLC_SUCCESS;
     }
     case ES_OUT_PRIV_SET_JITTER:
diff --git a/src/input/es_out.h b/src/input/es_out.h
index 8ab41a80bf8..9c592a9d208 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -81,7 +81,7 @@ enum es_out_query_private_e
     ES_OUT_PRIV_SET_FRAME_NEXT,                     /*                          res=can fail */
 
     /* Set position/time/length */
-    ES_OUT_PRIV_SET_TIMES,                          /* arg1=double f_position arg2=vlc_tick_t i_time arg3=vlc_tick_t i_normal_time arg4=vlc_tick_t i_length res=cannot fail */
+    ES_OUT_PRIV_SET_TIMES,                          /* arg1=double f_position arg2=vlc_tick_t i_time arg3=vlc_tick_t i_length res=cannot fail */
 
     /* Set jitter */
     ES_OUT_PRIV_SET_JITTER,                         /* arg1=vlc_tick_t i_pts_delay arg2= vlc_tick_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
@@ -204,11 +204,10 @@ static inline int es_out_SetFrameNext( es_out_t *p_out )
     return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_FRAME_NEXT );
 }
 static inline void es_out_SetTimes( es_out_t *p_out, double f_position,
-                                    vlc_tick_t i_time, vlc_tick_t i_normal_time,
-                                    vlc_tick_t i_length )
+                                    vlc_tick_t i_time, vlc_tick_t i_length )
 {
     int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_TIMES, f_position, i_time,
-                                    i_normal_time, i_length );
+                                    i_length );
     assert( !i_ret );
 }
 static inline void es_out_SetJitter( es_out_t *p_out,
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 2ecc7c3b6bd..d696bd28c12 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -167,7 +167,6 @@ typedef struct attribute_packed
         {
             double  f_position;
             vlc_tick_t i_time;
-            vlc_tick_t i_normal_time;
             vlc_tick_t i_length;
         } times;
     } u;
@@ -1787,12 +1786,10 @@ static int CmdInitPrivControl( ts_cmd_privcontrol_t *p_cmd, int i_query, va_list
     {
         double f_position = va_arg( args, double );
         vlc_tick_t i_time = va_arg( args, vlc_tick_t );
-        vlc_tick_t i_normal_time = va_arg( args, vlc_tick_t );
         vlc_tick_t i_length = va_arg( args, vlc_tick_t );
 
         p_cmd->u.times.f_position = f_position;
         p_cmd->u.times.i_time = i_time;
-        p_cmd->u.times.i_normal_time = i_normal_time;
         p_cmd->u.times.i_length = i_length;
         break;
     }
@@ -1822,7 +1819,6 @@ static int CmdExecutePrivControl( es_out_t *p_tsout, ts_cmd_privcontrol_t *p_cmd
         return es_out_PrivControl( p_sys->p_out, i_query,
                                    p_cmd->u.times.f_position,
                                    p_cmd->u.times.i_time,
-                                   p_cmd->u.times.i_normal_time,
                                    p_cmd->u.times.i_length );
     case ES_OUT_PRIV_SET_EOS: /* no arg */
         return es_out_PrivControl( p_sys->p_out, i_query );
diff --git a/src/input/event.h b/src/input/event.h
index dd9aec4a871..3899563889d 100644
--- a/src/input/event.h
+++ b/src/input/event.h
@@ -56,12 +56,11 @@ static inline void input_SendEventCapabilities(input_thread_t *p_input,
 
 static inline void input_SendEventTimes(input_thread_t *p_input,
                                         double f_position, vlc_tick_t i_time,
-                                        vlc_tick_t i_normal_time,
                                         vlc_tick_t i_length)
 {
     input_SendEvent(p_input, &(struct vlc_input_event) {
         .type = INPUT_EVENT_TIMES,
-        .times = { f_position, i_time, i_normal_time, i_length }
+        .times = { f_position, i_time, i_length }
     });
 }
 
diff --git a/src/input/input.c b/src/input/input.c
index ea64473a0bf..940f311c358 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -313,7 +313,6 @@ static input_thread_t *Create( vlc_object_t *p_parent,
     priv->is_stopped = false;
     priv->b_recording = false;
     priv->rate = 1.f;
-    priv->normal_time = VLC_TICK_0;
     TAB_INIT( priv->i_attachment, priv->attachment );
     priv->p_sout   = NULL;
     priv->b_out_pace_control = priv->b_thumbnailing;
@@ -632,12 +631,7 @@ static void MainLoopStatistics( input_thread_t *p_input )
     if( demux_Control( priv->master->p_demux, DEMUX_GET_LENGTH, &i_length ) )
         i_length = 0;
 
-    /* In case of failure (not implemented or in case of seek), use the last
-     * normal_time value (that is VLC_TICK_0 by default). */
-    demux_Control( priv->master->p_demux, DEMUX_GET_NORMAL_TIME, &priv->normal_time );
-
-    es_out_SetTimes( priv->p_es_out, f_position, i_time, priv->normal_time,
-                     i_length );
+    es_out_SetTimes( priv->p_es_out, f_position, i_time, i_length );
 
     struct input_stats_t new_stats;
     if( priv->stats != NULL )
@@ -1292,8 +1286,7 @@ static int Init( input_thread_t * p_input )
     if( i_length == 0 )
         i_length = input_item_GetDuration( priv->p_item );
 
-    input_SendEventTimes( p_input, 0.0, VLC_TICK_INVALID, priv->normal_time,
-                          i_length );
+    input_SendEventTimes( p_input, 0.0, VLC_TICK_INVALID, i_length );
 
     if( !priv->b_preparsing )
     {
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index 7279fb0becc..f4bed76fe72 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -162,7 +162,6 @@ struct vlc_input_event_times
 {
     float percentage;
     vlc_tick_t ms;
-    vlc_tick_t normal_time;
     vlc_tick_t length;
 };
 
-- 
2.30.0



More information about the vlc-devel mailing list