Commit 5bbb270e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: use libvlc preparser

parent 72b22e2b
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment