]> git.sesse.net Git - vlc/commitdiff
various modules: adjust to new playlist design
authorJakob Leben <jleben@videolan.org>
Tue, 2 Feb 2010 03:24:18 +0000 (04:24 +0100)
committerJakob Leben <jleben@videolan.org>
Tue, 2 Feb 2010 05:12:59 +0000 (06:12 +0100)
22 files changed:
modules/access/cdda.c
modules/access/mms/mmsh.c
modules/demux/mp4/mp4.c
modules/demux/playlist/asx.c
modules/demux/playlist/b4s.c
modules/demux/playlist/dvb.c
modules/demux/playlist/gvp.c
modules/demux/playlist/ifo.c
modules/demux/playlist/m3u.c
modules/demux/playlist/pls.c
modules/demux/playlist/podcast.c
modules/demux/playlist/qtl.c
modules/demux/playlist/ram.c
modules/demux/playlist/sgimb.c
modules/demux/playlist/shoutcast.c
modules/demux/playlist/wpl.c
modules/demux/playlist/zpl.c
modules/gui/macosx/playlist.m
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/misc/lua/vlc.c
modules/services_discovery/upnp_cc.cpp

index 6dface0daa05b8b837f749e55ab34210ea1158c6..833e36aff0cc453ef11c105778cdbef984313045 100644 (file)
@@ -480,6 +480,8 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
                                CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
     input_item_SetDuration( p_current, i_duration );
 
+    input_item_node_t *p_root = input_item_node_Create( p_current );
+
     /* Build title table */
     for( int i = 0; i < i_titles; i++ )
     {
@@ -576,6 +578,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
         input_item_SetTrackNum( p_input_item, psz_num );
 
         input_item_AddSubItem( p_current, p_input_item );
+        input_item_node_AppendItem( p_root, p_input_item );
         vlc_gc_decref( p_input_item );
         free( psz_uri ); free( psz_opt ); free( psz_name );
         free( psz_first ); free( psz_last );
@@ -583,6 +586,9 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
 #undef ON_EMPTY
 #undef NONEMPTY
 
+    input_item_AddSubItemTree( p_root );
+    input_item_node_Delete( p_root );
+
     /* */
     for( int i = 0; i < i_cd_text; i++ )
     {
index b89565ccfd6f8033a47f189ec6a2e18c6a6f8487..fceea8b965fe12c61d4f11b433bcfa775c5dc916 100644 (file)
@@ -165,7 +165,10 @@ int MMSHOpen( access_t *p_access )
         }
         /** \bug we do not autodelete here */
         p_new_loc = input_item_New( p_access, psz_location, psz_location );
-        input_item_AddSubItem( input_GetItem( p_input ), p_new_loc );
+        input_item_t *p_item = input_GetItem( p_input );
+        input_item_AddSubItem( p_item, p_new_loc );
+        input_item_AddSubItem2( p_item, p_new_loc );
+
         vlc_gc_decref( p_new_loc );
         vlc_object_release( p_input );
 
index c07bb1d67af090a55333552be5aab56c223024ee..cf1827e6d5252fda551863d162eae057d14f1d47 100644 (file)
@@ -370,6 +370,8 @@ static int Open( vlc_object_t * p_this )
         input_thread_t *p_input = demux_GetParentInput( p_demux );
         input_item_t *p_current = input_GetItem( p_input );
 
+        input_item_node_t *p_subitems = input_item_node_Create( p_current );
+
         for( i = 0; i < i_count; i++ )
         {
             MP4_Box_t *p_rdrf = MP4_BoxGet( p_rmra, "rmda[%d]/rdrf", i );
@@ -422,6 +424,7 @@ static int Open( vlc_object_t * p_this )
                 input_item_t *p_input = input_item_New( p_demux, psz_ref, NULL );
                 input_item_CopyOptions( p_current, p_input );
                 input_item_AddSubItem( p_current, p_input );
+                input_item_node_AppendItem( p_subitems, p_input );
                 vlc_gc_decref( p_input );
             }
             else
@@ -431,6 +434,8 @@ static int Open( vlc_object_t * p_this )
             }
             free( psz_ref );
         }
+        input_item_AddSubItemTree( p_subitems );
+        input_item_node_Delete( p_subitems );
         vlc_object_release( p_input );
     }
 
index 06810f66b2cc651cc622831e0b0598d5166ef4ca..5099c9a8cccda6f848bcbc2f711481c006b951ab 100644 (file)
@@ -261,6 +261,8 @@ static int Demux( demux_t *p_demux )
         if( p_sys->i_data_len <= 0 ) return -1;
     }
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     psz_parse = p_sys->psz_data;
     /* Find first element */
     if( ( psz_parse = strcasestr( psz_parse, "<ASX" ) ) )
@@ -472,6 +474,7 @@ static int Demux( demux_t *p_demux )
                             p_input = input_item_New( p_demux, psz_string, psz_title_asx );
                             input_item_CopyOptions( p_current_input, p_input );
                             input_item_AddSubItem( p_current_input, p_input );
+                            input_item_node_AppendItem( p_subitems, p_input );
                             vlc_gc_decref( p_input );
                             free( psz_string );
                         }
@@ -570,6 +573,7 @@ static int Demux( demux_t *p_demux )
                                 vlc_gc_decref( uniq_entry_ad_backup );
                             }
                             input_item_AddSubItem( p_current_input, p_entry );
+                            input_item_node_AppendItem( p_subitems, p_entry );
                             vlc_gc_decref( p_entry );
                         }
                     }
@@ -647,6 +651,7 @@ static int Demux( demux_t *p_demux )
                                 if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
                                 if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
                                 input_item_AddSubItem( p_current_input, p_entry );
+                                input_item_node_AppendItem( p_subitems, p_entry );
                                 vlc_gc_decref( p_entry );
                             }
 
@@ -750,6 +755,7 @@ static int Demux( demux_t *p_demux )
             msg_Dbg( p_demux, "added unique entry even if ad");
             /* If ASX contains a unique entry, we add it, it is probably not an ad */
             input_item_AddSubItem( p_current_input, uniq_entry_ad_backup );
+            input_item_node_AppendItem( p_subitems, uniq_entry_ad_backup );
             vlc_gc_decref( uniq_entry_ad_backup);
         }
 #if 0
@@ -761,6 +767,10 @@ static int Demux( demux_t *p_demux )
             STARTMARK
 #endif
     }
+
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 }
index e6ebe08375ec483bdab9ff5883e5b102f862bcf9..c9d12ad4b9ca6f1fceee38ac8f5067df94f18202 100644 (file)
@@ -80,6 +80,7 @@ static int Demux( demux_t *p_demux )
     input_item_t *p_input;
     char *psz_mrl = NULL, *psz_title = NULL, *psz_genre = NULL;
     char *psz_now = NULL, *psz_listeners = NULL, *psz_bitrate = NULL;
+    input_item_node_t *p_subitems = NULL;
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
@@ -161,6 +162,8 @@ static int Demux( demux_t *p_demux )
         free( psz_value );
     }
 
+    p_subitems = input_item_node_Create( p_current_input );
+
     while( (i_ret = xml_ReaderRead( p_xml_reader )) == 1 )
     {
         // Get the node type
@@ -265,6 +268,7 @@ static int Demux( demux_t *p_demux )
                         msg_Err( p_demux, "Unsupported meta bitrate" );
 
                     input_item_AddSubItem( p_current_input, p_input );
+                    input_item_node_AppendItem( p_subitems, p_input );
                     vlc_gc_decref( p_input );
                     FREENULL( psz_title );
                     FREENULL( psz_mrl );
@@ -290,6 +294,12 @@ static int Demux( demux_t *p_demux )
 end:
     free( psz_elname );
 
+    if( p_subitems )
+    {
+        input_item_AddSubItemTree( p_subitems );
+        input_item_node_Delete( p_subitems );
+    }
+
     vlc_gc_decref( p_current_input );
     if( p_xml_reader )
         xml_ReaderDelete( p_xml, p_xml_reader );
index 9a7d6e295d3f67d96c75e6936128080c06f3424c..b7c1dbaf67c08a8d7e8b0b5b463bb9b79393ec7c 100644 (file)
@@ -102,6 +102,8 @@ static int Demux( demux_t *p_demux )
     input_item_t *p_input;
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     while( (psz_line = stream_ReadLine( p_demux->s )) )
     {
         char **ppsz_options = NULL;
@@ -121,6 +123,7 @@ static int Demux( demux_t *p_demux )
         p_input = input_item_NewExt( p_demux, "dvb://", psz_name,
                                      i_options, (const char**)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
         input_item_AddSubItem( p_current_input, p_input );
+        input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
 
         while( i_options-- )
@@ -130,6 +133,9 @@ static int Demux( demux_t *p_demux )
         free( psz_line );
     }
 
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 }
index 59299d738b6e755df94acf3cb8f02746791ff4a8..f1836a6fbd2c03faed5d6655ac8644108d5be63d 100644 (file)
@@ -131,6 +131,8 @@ static int Demux( demux_t *p_demux )
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     p_sys->p_current_input = p_current_input;
 
     while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
@@ -209,9 +211,13 @@ static int Demux( demux_t *p_demux )
         SADD_INFO( "docid", psz_docid );
         SADD_INFO( "description", psz_description );
         input_item_AddSubItem( p_current_input, p_input );
+        input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
     }
 
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
 
     free( psz_version );
index c8043ba4cab202a9c18b0ce59682022793b3408d..b66a42e2dc168083cd9ad81c9a1b03e23d30aefa 100644 (file)
@@ -111,6 +111,7 @@ static int Demux( demux_t *p_demux )
     input_item_t *p_current_input = GetCurrentItem(p_demux);
     input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url );
     input_item_AddSubItem( p_current_input, p_input );
+    input_item_AddSubItem2( p_current_input, p_input );
     vlc_gc_decref( p_input );
 
     vlc_gc_decref(p_current_input);
@@ -133,6 +134,8 @@ static int DemuxDVD_VR( demux_t *p_demux )
     input_item_t *p_current_input = GetCurrentItem(p_demux);
     input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url );
     input_item_AddSubItem( p_current_input, p_input );
+    input_item_AddSubItem2( p_current_input, p_input );
+
     vlc_gc_decref( p_input );
 
     vlc_gc_decref(p_current_input);
index e4168ad8125bc0ad63b802415d582ce1e9a4f76b..e405b14a6305ca263ae169115ce650d9713cf521 100644 (file)
@@ -145,6 +145,7 @@ static int Demux( demux_t *p_demux )
     input_item_t *p_input;
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
 
     psz_line = stream_ReadLine( p_demux->s );
     while( psz_line )
@@ -227,6 +228,7 @@ static int Demux( demux_t *p_demux )
             if( psz_name ) input_item_SetTitle( p_input, psz_name );
 
             input_item_AddSubItem( p_current_input, p_input );
+            input_item_node_AppendItem( p_subitems, p_input );
             vlc_gc_decref( p_input );
         }
 
@@ -253,6 +255,8 @@ static int Demux( demux_t *p_demux )
             b_cleanup = false;
         }
     }
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "m3u-extvlcopt" );
     return 0; /* Needed for correct operation of go back */
index c0427eb47ef4c3dad1ff601958cf5293a9ab080b..0c76cfa9a2724cb780e56a4ad1533730f87af13a 100644 (file)
@@ -93,6 +93,8 @@ static int Demux( demux_t *p_demux )
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
     {
         if( !strncasecmp( psz_line, "[playlist]", sizeof("[playlist]")-1 ) ||
@@ -162,6 +164,7 @@ static int Demux( demux_t *p_demux )
                 p_input = input_item_New( p_demux, psz_mrl, psz_name );
                 input_item_CopyOptions( p_current_input, p_input );
                 input_item_AddSubItem( p_current_input, p_input );
+                input_item_node_AppendItem( p_subitems, p_input );
                 vlc_gc_decref( p_input );
             }
             else
@@ -217,6 +220,7 @@ static int Demux( demux_t *p_demux )
         p_input = input_item_New( p_demux, psz_mrl, psz_name );
         input_item_CopyOptions( p_current_input, p_input );
         input_item_AddSubItem( p_current_input, p_input );
+        input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
         free( psz_mrl_orig );
         psz_mrl = NULL;
@@ -228,6 +232,9 @@ static int Demux( demux_t *p_demux )
     free( psz_name );
     psz_name = NULL;
 
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 }
index ee95cea5f14d5b205e7494d1aa7947187375be35..253eaba688c11cee3215a218f2259bd5d96d1401 100644 (file)
@@ -90,6 +90,7 @@ static int Demux( demux_t *p_demux )
     char *psz_art_url = NULL;
     int i_type;
     input_item_t *p_input;
+    input_item_node_t *p_subitems = NULL;
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
@@ -128,6 +129,8 @@ static int Demux( demux_t *p_demux )
     }
     FREENULL( psz_elname );
 
+    p_subitems = input_item_node_Create( p_current_input );
+
     while( (i_ret = xml_ReaderRead( p_xml_reader )) == 1 )
     {
         // Get the node type
@@ -329,6 +332,7 @@ static int Demux( demux_t *p_demux )
                                                 psz_item_size );
                     }
                     input_item_AddSubItem( p_current_input, p_input );
+                    input_item_node_AppendItem( p_subitems, p_input );
                     vlc_gc_decref( p_input );
                     FREENULL( psz_item_name );
                     FREENULL( psz_item_mrl );
@@ -365,6 +369,8 @@ static int Demux( demux_t *p_demux )
     xml_ReaderDelete( p_xml, p_xml_reader );
     xml_Delete( p_xml );
 
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 
@@ -387,6 +393,11 @@ error:
         xml_ReaderDelete( p_xml, p_xml_reader );
     if( p_xml )
         xml_Delete( p_xml );
+    if( p_subitems )
+    {
+        input_item_AddSubItemTree( p_subitems );
+        input_item_node_Delete( p_subitems );
+    }
 
     vlc_gc_decref(p_current_input);
     return -1;
index 51f5a5ebee72a0f67121de15894db16477b7dcf5..d93142ead9ccfb4fac3cf522f8ddf23e49de5781 100644 (file)
@@ -304,19 +304,24 @@ static int Demux( demux_t *p_demux )
     }
     else
     {
+        input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
         p_input = input_item_New( p_demux, psz_src, psz_moviename );
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
                     p_input, "QuickTime Media Link", type, "%s", field ) ; }
         SADD_INFO( "href", psz_href );
         SADD_INFO( _("Mime"), psz_mimetype );
         input_item_AddSubItem( p_current_input, p_input );
+        input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
         if( psz_qtnext )
         {
             p_input = input_item_New( p_demux, psz_qtnext, NULL );
             input_item_AddSubItem( p_current_input, p_input );
+            input_item_node_AppendItem( p_subitems, p_input );
             vlc_gc_decref( p_input );
         }
+        input_item_AddSubItemTree( p_subitems );
+        input_item_node_Delete( p_subitems );
     }
 
     i_ret = 0; /* Needed for correct operation of go back */
index 8542f0631ef2b2a3f005c4f8079f1920aa6ddb67..ce7cc822be212a969ab6a07ca6d9635ea80c8044 100644 (file)
@@ -214,6 +214,8 @@ static int Demux( demux_t *p_demux )
 
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     psz_line = stream_ReadLine( p_demux->s );
     while( psz_line )
     {
@@ -326,6 +328,7 @@ static int Demux( demux_t *p_demux )
             if( !EMPTY_STR( psz_comments ) ) input_item_SetDescription( p_input, psz_comments );
 
             input_item_AddSubItem( p_current_input, p_input );
+            input_item_node_AppendItem( p_subitems, p_input );
             vlc_gc_decref( p_input );
             free( psz_mrl );
         }
@@ -358,6 +361,8 @@ static int Demux( demux_t *p_demux )
             b_cleanup = false;
         }
     }
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "m3u-extvlcopt" );
     return 0; /* Needed for correct operation of go back */
index d0a32004857905aa14eb0c40e9d6b78dc2f387e4..9a4ddfd56b689d6246e45fed480fedb0d69435bf 100644 (file)
@@ -403,6 +403,7 @@ static int Demux ( demux_t *p_demux )
         input_item_AddOption( p_child, "rtsp-kasenna", VLC_INPUT_OPTION_TRUSTED );
 
     input_item_AddSubItem( p_current_input, p_child );
+    input_item_AddSubItem2( p_current_input, p_child );
     vlc_gc_decref( p_child );
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
index b6935c83709e0bb1173b4b4fd0dec440641a905a..c007e9d1d0a0527dc0e45302208bdeb1f2f5f381 100644 (file)
@@ -48,9 +48,9 @@ static int Demux( demux_t *p_demux);
 static int Control( demux_t *p_demux, int i_query, va_list args );
 
 static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
-                       input_item_t *p_current_input );
+                       input_item_node_t *p_input_node );
 static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
-                         input_item_t *p_current_input, bool b_adult );
+                         input_item_node_t *p_input_node, bool b_adult );
 
 /*****************************************************************************
  * Import_Shoutcast: main import function
@@ -110,20 +110,24 @@ static int Demux( demux_t *p_demux )
         goto error;
     }
 
+    input_item_node_t *p_input_node = input_item_node_Create( p_current_input );
+
     if( !strcmp( psz_eltname, "genrelist" ) )
     {
         /* we're reading a genre list */
-        if( DemuxGenre( p_demux, p_xml_reader, p_current_input ) )
+        if( DemuxGenre( p_demux, p_xml_reader, p_input_node ) )
             goto error;
     }
     else
     {
         /* we're reading a station list */
-        if( DemuxStation( p_demux, p_xml_reader, p_current_input,
+        if( DemuxStation( p_demux, p_xml_reader, p_input_node,
                 var_CreateGetBool( p_demux, "shoutcast-show-adult" ) ) )
             goto error;
     }
 
+    input_item_AddSubItemTree( p_input_node );
+
     i_ret = 0; /* Needed for correct operation of go back */
 
 error:
@@ -132,6 +136,7 @@ error:
     if( p_xml )
         xml_Delete( p_xml );
     free( psz_eltname );
+    input_item_node_Delete( p_input_node );
     vlc_gc_decref(p_current_input);
     return i_ret;
 }
@@ -148,7 +153,7 @@ error:
  * </genrelist>
  **/
 static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
-                       input_item_t *p_current_input )
+                       input_item_node_t *p_input_node )
 {
     char *psz_name = NULL; /* genre name */
     int i_ret = -1;
@@ -219,9 +224,10 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
                     {
                         input_item_t *p_input;
                         p_input = input_item_New( p_demux, psz_mrl, psz_name );
-                        input_item_CopyOptions( p_current_input, p_input );
+                        input_item_CopyOptions( p_input_node->p_item, p_input );
                         free( psz_mrl );
-                        input_item_AddSubItem( p_current_input, p_input );
+                        input_item_AddSubItem( p_input_node->p_item, p_input );
+                        input_item_node_AppendItem( p_input_node, p_input );
                         vlc_gc_decref( p_input );
                     }
                     FREENULL( psz_name );
@@ -264,7 +270,7 @@ error:
  * </stationlist>
  **/
 static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
-                         input_item_t *p_current_input, bool b_adult )
+                         input_item_node_t *p_input_node, bool b_adult )
 {
     char *psz_base = NULL; /* */
 
@@ -395,7 +401,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
                     /* Create the item */
                     input_item_t *p_input;
                     p_input = input_item_New( p_demux, psz_mrl, psz_name );
-                    input_item_CopyOptions( p_current_input, p_input );
+                    input_item_CopyOptions( p_input_node->p_item, p_input );
                     free( psz_mrl );
 
 #define SADD_INFO( type, field ) \
@@ -412,7 +418,8 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
                         input_item_SetNowPlaying( p_input, psz_ct );
                     if( psz_rt )
                         input_item_SetRating( p_input, psz_rt );
-                    input_item_AddSubItem( p_current_input, p_input );
+                    input_item_AddSubItem( p_input_node->p_item, p_input );
+                    input_item_node_AppendItem( p_input_node, p_input );
                     vlc_gc_decref( p_input );
                     FREENULL( psz_base );
                     FREENULL( psz_name );
index 488d2efd2eb89957a69dcbfc71de98ddca9b3979..98e8ef3960f760ecdf62e3f094534f821bfee78d 100644 (file)
@@ -78,6 +78,8 @@ static int Demux( demux_t *p_demux )
     char       *psz_line;
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     while( (psz_line = stream_ReadLine( p_demux->s )) )
     {
         char *psz_parse = psz_line;
@@ -101,6 +103,8 @@ static int Demux( demux_t *p_demux )
                 p_input = input_item_NewExt( p_demux, psz_uri, psz_uri,
                                         0, NULL, 0, -1 );
                 input_item_AddSubItem( p_current_input, p_input );
+                input_item_node_AppendItem( p_subitems, p_input );
+                vlc_gc_decref( p_input );
             }
         }
 
@@ -108,6 +112,10 @@ static int Demux( demux_t *p_demux )
         free( psz_line );
 
     }
+
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "wpl-extvlcopt" );
     return 0; /* Needed for correct operation of go back */
index 8d64afc47ff36a56a35e31629c04487a68dc1825..b9ee3d23b4c3f5d363e1373a33fe587a7a3bc224 100644 (file)
@@ -103,6 +103,8 @@ static int Demux( demux_t *p_demux )
         psz_line = stream_ReadLine( p_demux->s );
     }
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     /* Loop on all lines */
     while( psz_line )
     {
@@ -167,6 +169,7 @@ static int Demux( demux_t *p_demux )
             input_item_t *p_input = input_item_NewExt( p_demux, psz_mrl,
                                         psz_title, 0, NULL, 0, i_duration );
             input_item_AddSubItem( p_current_input, p_input );
+            input_item_node_AppendItem( p_subitems, p_input );
             FREENULL( psz_mrl );
             FREENULL( psz_title );
             i_duration = -1;
@@ -189,6 +192,7 @@ static int Demux( demux_t *p_demux )
             SET( psz_copyright, Copyright );
 #undef SET
 
+            vlc_gc_decref( p_input );
         }
         else
             msg_Warn( p_demux, "invalid line '%s'", psz_parse );
@@ -198,6 +202,9 @@ static int Demux( demux_t *p_demux )
         psz_line = stream_ReadLine( p_demux->s );
     }
 
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "zpl-extvlcopt" );
     return 0; /* Needed for correct operation of go back */
index 031accd018ff7df38e2b3f12501c39030b1c8023..2d10202e5ed8f6fedbbc9ccbc351aa1f3f844fca 100644 (file)
         if( !p_input ) continue;
 
         /* Add the item */
-        /* FIXME: playlist_BothAddInput() can fail */
         PL_LOCK;
-        playlist_BothAddInput( p_playlist, p_input, p_node,
+        playlist_NodeAddInput( p_playlist, p_input, p_node,
                                       PLAYLIST_INSERT,
                                       i_position == -1 ?
                                       PLAYLIST_END : i_position + i_item,
-                                      NULL, NULL, pl_Locked );
+                                      pl_Locked );
 
 
         if( i_item == 0 && !b_enqueue )
index 0e8860e294ab8f5b0bb0484d5abbfe167ce464a7..8ebc9c3eba0a6c73e0fb4244017a187d05f657a4 100644 (file)
@@ -79,8 +79,8 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
     /* Initialisation of the playlist */
     playlist_t * p_playlist = THEPL;
     PL_LOCK;
-    playlist_item_t *p_root =
-                  playlist_GetPreferredNode( THEPL, THEPL->p_local_category );
+    playlist_item_t *p_root = THEPL->p_playing;
+
     PL_UNLOCK;
 
     rightPanel = new StandardPLPanel( this, p_intf, THEPL, p_root );
index 7241cf1895e62ebff481257b22e59e46bd310276..2cade837cce6fb395e90cecaf3a17bbd8fdd96a2 100644 (file)
@@ -230,9 +230,6 @@ void StandardPLPanel::setRoot( playlist_item_t *p_item )
     QPL_LOCK;
     assert( p_item );
 
-    playlist_item_t *p_pref_item = playlist_GetPreferredNode( THEPL, p_item );
-    if( p_pref_item ) p_item = p_pref_item;
-
     /* needed for popupAdd() */
     currentRootId = p_item->i_id;
 
@@ -437,9 +434,16 @@ void StandardPLPanel::browseInto( input_item_t *p_input )
     playlist_Lock( THEPL );
 
     playlist_item_t *p_item = playlist_ItemGetByInput( THEPL, p_input );
-    assert( p_item != NULL );
+    if( !p_item )
+    {
+        playlist_Unlock( THEPL );
+        return;
+    }
 
     QModelIndex index = model->index( p_item->i_id, 0 );
+
+    playlist_Unlock( THEPL );
+
     if( currentView == iconView ) {
         iconView->setRootIndex( index );
         locationBar->setIndex( index );
@@ -449,7 +453,7 @@ void StandardPLPanel::browseInto( input_item_t *p_input )
 
     last_activated_id = -1;
 
-    playlist_Unlock( THEPL );
+
 }
 
 LocationBar::LocationBar( PLModel *m )
index bb4ba982fa1680071e56f54e5a214d1d2749671f..28a6c20edf44156a855f9e6fb82148ec7b3755d1 100644 (file)
@@ -473,7 +473,10 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
 
                     /* Append item to playlist */
                     if( p_parent ) /* Add to node */
+                    {
                         input_item_AddSubItem( p_parent, p_input );
+                        input_item_AddSubItem2( p_parent, p_input );
+                    }
                     else /* Play or Enqueue (preparse) */
                         /* FIXME: playlist_AddInput() can fail */
                         playlist_AddInput( p_playlist, p_input,
index b830c9fbcf717962a3fd980687201ea46eff2c27..7b72db632e3042299893578a31b781a7ed4e23eb 100644 (file)
@@ -204,8 +204,8 @@ void UPnPHandler::AddContent( playlist_item_t *p_parent, ContentNode *node )
         ItemNode *iNode = (ItemNode *)node;
         input_item_t *p_input = input_item_New( p_sd, iNode->getResource(), title );
         /* FIXME: playlist_AddInput() can fail */
-        playlist_BothAddInput( p_playlist, p_input, p_parent,
-                               PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL,
+        playlist_NodeAddInput( p_playlist, p_input, p_parent,
+                               PLAYLIST_APPEND, PLAYLIST_END,
                                false );
         vlc_gc_decref( p_input );
     } else if ( node->isContainerNode() )