[vlc-commits] playlist: use libvlc preparser
Rémi Denis-Courmont
git at videolan.org
Thu Jun 30 20:56:19 CEST 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 21 16:25:36 2016 +0300| [5bbb270e61eced621434433590a64f7b05132581] | committer: Rémi Denis-Courmont
playlist: use libvlc preparser
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5bbb270e61eced621434433590a64f7b05132581
---
src/playlist/engine.c | 11 +----------
src/playlist/item.c | 6 ++++--
src/playlist/playlist_internal.h | 2 +-
3 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 1ff64c7..7c00a48 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -229,6 +229,7 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
pl_priv(p_playlist)->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_tree = var_InheritBool( p_parent, "playlist-tree" );
+ pl_priv(p_playlist)->b_preparse = var_InheritBool( p_parent, "auto-preparse" );
/* Create the root, playing items and meida library nodes */
playlist_item_t *root, *playing, *ml;
@@ -266,14 +267,6 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
if (ml != NULL)
playlist_MLLoad( p_playlist );
- /* 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 */
p->p_input_resource = input_resource_New( VLC_OBJECT( p_playlist ) );
if( unlikely(p->p_input_resource == NULL) )
@@ -326,8 +319,6 @@ void playlist_Destroy( playlist_t *p_playlist )
msg_Dbg( p_playlist, "destroying" );
playlist_Deactivate( p_playlist );
- if( p_sys->p_preparser )
- playlist_preparser_Delete( p_sys->p_preparser );
/* Release input resources */
assert( p_sys->p_input == NULL );
diff --git a/src/playlist/item.c b/src/playlist/item.c
index 7d3c218..a023f47 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -779,9 +779,11 @@ 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->p_preparser != NULL && !input_item_IsPreparsed( p_item->p_input )
+
+ if( sys->b_preparse && !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, 0, -1, NULL );
+ libvlc_MetadataRequest( p_playlist->obj.libvlc, p_item->p_input, 0, -1,
+ NULL );
free( psz_artist );
free( psz_album );
}
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index 20fa472..d655dc3 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -47,7 +47,6 @@ void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );
typedef struct playlist_private_t
{
playlist_t public_data;
- playlist_preparser_t *p_preparser; /**< Preparser data */
struct intf_thread_t *interface; /**< Linked-list of interfaces */
playlist_item_array_t items_to_delete; /**< Array of items and nodes to
@@ -87,6 +86,7 @@ typedef struct playlist_private_t
bool b_reset_currently_playing; /** Reset current item array */
bool b_tree; /**< Display as a tree */
+ bool b_preparse; /**< Preparse items */
} playlist_private_t;
#define pl_priv( pl ) ((playlist_private_t *)(pl))
More information about the vlc-commits
mailing list