[vlc-commits] playlist: remove b_auto_preparse

Rémi Denis-Courmont git at videolan.org
Mon Mar 10 20:36:16 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 10 21:35:58 2014 +0200| [2893fcef61da1e6df290683e9fe967f5d11e7e63] | committer: Rémi Denis-Courmont

playlist: remove b_auto_preparse

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

 src/playlist/engine.c            |   19 +++++++------------
 src/playlist/item.c              |    2 +-
 src/playlist/playlist_internal.h |    1 -
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index d9af6f0..4890d0a 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -230,14 +230,6 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
 
     pl_priv(p_playlist)->b_doing_ml = false;
 
-    pl_priv(p_playlist)->b_auto_preparse =
-        var_InheritBool( p_parent, "auto-preparse" );
-
-   /* Preparser (and meta retriever) */
-   p->p_preparser = playlist_preparser_New( VLC_OBJECT(p_playlist) );
-   if( unlikely(p->p_preparser == NULL) )
-       msg_Err( p_playlist, "cannot create preparser" );
-
     /* Create the root node */
     PL_LOCK;
     p_playlist->p_root = playlist_NodeCreate( p_playlist, NULL, NULL,
@@ -284,11 +276,14 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
     pl_priv(p_playlist)->status.i_status = PLAYLIST_STOPPED;
 
     if(b_ml)
-    {
-        const bool b_auto_preparse = pl_priv(p_playlist)->b_auto_preparse;
-        pl_priv(p_playlist)->b_auto_preparse = false;
         playlist_MLLoad( p_playlist );
-        pl_priv(p_playlist)->b_auto_preparse = b_auto_preparse;
+
+    /* Preparser (and meta retriever) _after_ the Media Library*/
+    if( var_InheritBool( p_parent, "auto-preparse" ) )
+    {
+        p->p_preparser = playlist_preparser_New( VLC_OBJECT(p_playlist) );
+        if( unlikely(p->p_preparser == NULL) )
+            msg_Err( p_playlist, "cannot create preparser" );
     }
 
     /* Input resources */
diff --git a/src/playlist/item.c b/src/playlist/item.c
index 1f1f43c..69426da 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -770,7 +770,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
        enabled*/
     char *psz_artist = input_item_GetArtist( p_item->p_input );
     char *psz_album = input_item_GetAlbum( p_item->p_input );
-    if( sys->b_auto_preparse && !input_item_IsPreparsed( p_item->p_input )
+    if( sys->p_preparser != NULL && !input_item_IsPreparsed( p_item->p_input )
      && (EMPTY_STR(psz_artist) || EMPTY_STR(psz_album)) )
         playlist_preparser_Push( sys->p_preparser, p_item->p_input );
     free( psz_artist );
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index 8141c40..51a3748 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -90,7 +90,6 @@ typedef struct playlist_private_t
 
     bool     b_tree; /**< Display as a tree */
     bool     b_doing_ml; /**< Doing media library stuff  get quicker */
-    bool     b_auto_preparse;
 } playlist_private_t;
 
 #define pl_priv( pl ) ((playlist_private_t *)(pl))



More information about the vlc-commits mailing list