[vlc-devel] [PATCH 8/8] RFC: input: always use the top level es_out

Thomas Guillem thomas at gllm.fr
Thu Feb 27 14:55:47 CET 2020


This commit doesn't affect most controls but change the behavior of ES
selection controls.

In that case, ES will be selected/unselected asynchronously if timeshift is
enabled (so, from the timeshift thread).

So my question is: do we want that ? In that case, we should also fix some
private ES selection controls that always bypass the timeshift thread (cf.
"Direct pass-through controls").

If we don't want that, then this patch and the previous one could be discarded.
---
 src/input/input.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 420f9d71ac5..1a67fb682ac 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2015,18 +2015,18 @@ static bool Control( input_thread_t *p_input,
 
         case INPUT_CONTROL_SET_ES_BY_ID:
             /* No need to force update, es_out does it if needed */
-            es_out_SetEsById( priv->p_es_out_display, param.val.i_int, true );
+            es_out_SetEsById( priv->p_es_out, param.val.i_int, true );
 
             demux_Control( priv->master->p_demux, DEMUX_SET_ES,
                            (int)param.val.i_int );
             break;
 
         case INPUT_CONTROL_RESTART_ES_BY_ID:
-            es_out_RestartEsById( priv->p_es_out_display, param.val.i_int );
+            es_out_RestartEsById( priv->p_es_out, param.val.i_int );
             break;
 
         case INPUT_CONTROL_SET_ES:
-            if( es_out_Control( input_priv(p_input)->p_es_out_display,
+            if( es_out_Control( priv->p_es_out,
                                 ES_OUT_SET_ES, vlc_es_id_get_out( param.id ) )
                                 == VLC_SUCCESS )
                 demux_Control( input_priv(p_input)->master->p_demux, DEMUX_SET_ES,
@@ -2034,7 +2034,7 @@ static bool Control( input_thread_t *p_input,
             break;
         case INPUT_CONTROL_SET_ES_LIST:
         {
-            if( es_out_SetEsList( input_priv(p_input)->p_es_out_display,
+            if( es_out_SetEsList( priv->p_es_out,
                                   param.list.cat, param.list.ids ) == VLC_SUCCESS )
             {
                 if( param.list.ids[0] != NULL && param.list.ids[1] == NULL )
@@ -2061,11 +2061,11 @@ static bool Control( input_thread_t *p_input,
             break;
         }
         case INPUT_CONTROL_UNSET_ES:
-            es_out_Control( input_priv(p_input)->p_es_out_display,
+            es_out_Control( priv->p_es_out,
                             ES_OUT_UNSET_ES, vlc_es_id_get_out(param.id) );
             break;
         case INPUT_CONTROL_RESTART_ES:
-            es_out_Control( input_priv(p_input)->p_es_out_display,
+            es_out_Control( priv->p_es_out,
                             ES_OUT_RESTART_ES, vlc_es_id_get_out( param.id ) );
             break;
 
@@ -2101,12 +2101,12 @@ static bool Control( input_thread_t *p_input,
         case INPUT_CONTROL_SET_CATEGORY_DELAY:
             assert(param.cat_delay.cat == AUDIO_ES
                 || param.cat_delay.cat == SPU_ES);
-            es_out_SetDelay(priv->p_es_out_display,
+            es_out_SetDelay(priv->p_es_out,
                             param.cat_delay.cat, param.cat_delay.delay);
             break;
         case INPUT_CONTROL_SET_ES_DELAY:
             assert(param.es_delay.id);
-            es_out_SetEsDelay(priv->p_es_out_display,
+            es_out_SetEsDelay(priv->p_es_out,
                               vlc_es_id_get_out(param.es_delay.id),
                               param.es_delay.delay);
             break;
@@ -2220,7 +2220,7 @@ static bool Control( input_thread_t *p_input,
                 }
                 else
                 {
-                    if( es_out_SetRecordState( priv->p_es_out_display, val.b_bool ) )
+                    if( es_out_SetRecordState( priv->p_es_out, val.b_bool ) )
                         val.b_bool = false;
                 }
                 priv->b_recording = val.b_bool;
@@ -2257,7 +2257,7 @@ static bool Control( input_thread_t *p_input,
                 break;
 
             void *context;
-            if( es_out_StopAllEs( priv->p_es_out_display, &context ) != VLC_SUCCESS )
+            if( es_out_StopAllEs( priv->p_es_out, &context ) != VLC_SUCCESS )
                 break;
 
             if ( p_priv->p_renderer )
@@ -2279,21 +2279,21 @@ static bool Control( input_thread_t *p_input,
                                         vlc_renderer_item_demux_filter( p_item ) );
                 }
             }
-            es_out_StartAllEs( priv->p_es_out_display, context );
+            es_out_StartAllEs( priv->p_es_out, context );
 #endif
             break;
         }
         case INPUT_CONTROL_SET_VBI_PAGE:
-            es_out_SetVbiPage( priv->p_es_out_display, param.vbi_page.id,
+            es_out_SetVbiPage( priv->p_es_out, param.vbi_page.id,
                                param.vbi_page.page );
             break;
         case INPUT_CONTROL_SET_VBI_TRANSPARENCY:
-            es_out_SetVbiTransparency( priv->p_es_out_display,
+            es_out_SetVbiTransparency( priv->p_es_out,
                                        param.vbi_transparency.id,
                                        param.vbi_transparency.enabled );
             break;
         case INPUT_CONTROL_SET_ES_AUTOSELECT:
-            es_out_SetAutoSelect( priv->p_es_out_display, param.es_autoselect.cat,
+            es_out_SetAutoSelect( priv->p_es_out, param.es_autoselect.cat,
                                   param.es_autoselect.enabled );
             break;
 
@@ -3323,8 +3323,8 @@ static int input_SlaveSourceAdd( input_thread_t *p_input,
 
     assert( priv->i_last_es_id != -1 );
 
-    es_out_SetEsDefaultById( priv->p_es_out_display, priv->i_last_es_id );
-    es_out_SetEsById( priv->p_es_out_display, priv->i_last_es_id, false );
+    es_out_SetEsDefaultById( priv->p_es_out, priv->i_last_es_id );
+    es_out_SetEsById( priv->p_es_out, priv->i_last_es_id, false );
 
     return VLC_SUCCESS;
 }
-- 
2.20.1



More information about the vlc-devel mailing list