[vlc-devel] [PATCH 3/3] preparser: merge item locks

Thomas Guillem thomas at gllm.fr
Thu Aug 22 14:22:54 CEST 2019


Since input_preparser_Push() is necessarilly called from vlc_MetadataRequest().
---
 src/libvlc.c              | 6 ------
 src/preparser/preparser.c | 2 ++
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 76dc15885c..ee88d363d4 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -514,12 +514,6 @@ int vlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item,
     if (unlikely(priv->parser == NULL))
         return VLC_ENOMEM;
 
-    if( i_options & META_REQUEST_OPTION_DO_INTERACT )
-    {
-        vlc_mutex_lock( &item->lock );
-        item->b_preparse_interact = true;
-        vlc_mutex_unlock( &item->lock );
-    }
     input_preparser_Push( priv->parser, item, i_options, cbs, cbs_userdata, timeout, id );
     return VLC_SUCCESS;
 
diff --git a/src/preparser/preparser.c b/src/preparser/preparser.c
index f3f678a2e1..51e2c3e311 100644
--- a/src/preparser/preparser.c
+++ b/src/preparser/preparser.c
@@ -267,6 +267,8 @@ void input_preparser_Push( input_preparser_t *preparser,
     vlc_mutex_lock( &item->lock );
     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;
     vlc_mutex_unlock( &item->lock );
 
     switch( i_type )
-- 
2.20.1



More information about the vlc-devel mailing list