[vlc-devel] [PATCH v3 05/11] input: change b_preparse_interact type

Thomas Guillem thomas at gllm.fr
Mon Dec 21 17:54:30 UTC 2020


No functional changes, will be used by the next commit.
---
 include/vlc_input_item.h  | 10 ++++++++--
 src/input/input.c         |  2 +-
 src/preparser/preparser.c |  2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 9a01a806725..7ee699f6811 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -118,8 +118,14 @@ struct input_item_t
     int         i_preparse_depth;    /**< How many level of sub items can be preparsed:
                                           -1: recursive, 0: none, >0: n levels */
 
-    bool        b_preparse_interact; /**< Force interaction with the user when
-                                          preparsing.*/
+    enum
+    {
+        /** Preparsing won't request any interaction from the user: no access
+         * to the system keystore and login dialog. */
+        INPUT_ITEM_PREPARSE_INTERACT_NONE,
+        /** Preparsing can request an UI interaction from the user. */
+        INPUT_ITEM_PREPARSE_INTERACT,
+    } preparse_interact;
 
     void        *libvlc_owner;       /**< LibVLC private data, can only be set
                                           before events are registered. */
diff --git a/src/input/input.c b/src/input/input.c
index 730d99db013..f3f957fae81 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -364,7 +364,7 @@ static input_thread_t *Create( vlc_object_t *p_parent,
     /* Make sure the interaction option is honored */
     if( !var_InheritBool( p_input, "interact" ) )
         p_input->obj.no_interact = true;
-    else if( p_item->b_preparse_interact )
+    else if( p_item->preparse_interact == INPUT_ITEM_PREPARSE_INTERACT )
     {
         /* If true, this item was asked explicitly to interact with the user
          * (via libvlc_MetadataRequest). Sub items created from this input won't
diff --git a/src/preparser/preparser.c b/src/preparser/preparser.c
index 5692e354e05..211a7f1ae4f 100644
--- a/src/preparser/preparser.c
+++ b/src/preparser/preparser.c
@@ -345,7 +345,7 @@ int input_preparser_Push( input_preparser_t *preparser,
     enum input_item_type_e i_type = item->i_type;
     int b_net = item->b_net;
     if( i_options & META_REQUEST_OPTION_DO_INTERACT )
-        item->b_preparse_interact = true;
+        item->preparse_interact = INPUT_ITEM_PREPARSE_INTERACT;
     vlc_mutex_unlock( &item->lock );
 
     switch( i_type )
-- 
2.29.2



More information about the vlc-devel mailing list