[vlc-commits] preparser: merge item locks

Thomas Guillem git at videolan.org
Mon Aug 26 09:29:46 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Aug 22 14:17:52 2019 +0200| [5ca9d7ea53f85d7e88ebef4ecd209568d123e27b] | committer: Thomas Guillem

preparser: merge item locks

Since input_preparser_Push() is necessarilly called from vlc_MetadataRequest().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ca9d7ea53f85d7e88ebef4ecd209568d123e27b
---

 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 )



More information about the vlc-commits mailing list