]> git.sesse.net Git - vlc/blobdiff - src/playlist/item.c
services_discovery: implement SD categories and use in Qt interface
[vlc] / src / playlist / item.c
index 48ee7bee89cfec37364f62946bcfc1a769b07a80..6d971f246ece4919291da55381d7f27ef4c1668c 100644 (file)
@@ -100,8 +100,9 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
         p_item = playlist_InsertInputItemTree( p_playlist, p_item,
                                                p_new_root, 0, false );
 
+    if( !b_flat ) var_SetAddress( p_playlist, "leaf-to-parent", p_input );
 
-    if( b_stop )
+    if( b_stop && !b_flat )
     {
         PL_UNLOCK;
         playlist_Stop( p_playlist );
@@ -444,6 +445,8 @@ playlist_item_t * playlist_NodeAddInput( playlist_t *p_playlist,
     if( p_item == NULL ) return NULL;
     AddItem( p_playlist, p_item, p_parent, i_mode, i_pos );
 
+    GoAndPreparse( p_playlist, i_mode, p_item );
+
     PL_UNLOCK_IF( !b_locked );
 
     return p_item;
@@ -714,18 +717,16 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
         pl_priv(p_playlist)->request.i_status = PLAYLIST_RUNNING;
         vlc_cond_signal( &pl_priv(p_playlist)->signal );
     }
-    /* Preparse if PREPARSE or SPREPARSE & not enough meta */
+    /* Preparse if no artist/album info, and hasn't been preparsed allready
+       and if user has some preparsing option (auto-preparse variable)
+       enabled*/
     char *psz_artist = input_item_GetArtist( p_item->p_input );
     char *psz_album = input_item_GetAlbum( p_item->p_input );
     if( pl_priv(p_playlist)->b_auto_preparse &&
-          (i_mode & PLAYLIST_PREPARSE ||
-          ( i_mode & PLAYLIST_SPREPARSE &&
+        input_item_IsPreparsed( p_item->p_input ) == false &&
             ( EMPTY_STR( psz_artist ) || ( EMPTY_STR( psz_album ) ) )
-          ) ) )
-        playlist_PreparseEnqueue( p_playlist, p_item->p_input, pl_Locked );
-    /* If we already have it, signal it */
-    else if( !EMPTY_STR( psz_artist ) && !EMPTY_STR( psz_album ) )
-        input_item_SetPreparsed( p_item->p_input, true );
+          )
+        playlist_PreparseEnqueue( p_playlist, p_item->p_input );
     free( psz_artist );
     free( psz_album );
 }