Use input_item_New when applicable.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 17 Jan 2009 18:09:11 +0000 (19:09 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 17 Jan 2009 18:23:49 +0000 (19:23 +0100)
16 files changed:
modules/demux/mp4/mp4.c
modules/demux/playlist/b4s.c
modules/demux/playlist/dvb.c
modules/demux/playlist/gvp.c
modules/demux/playlist/ifo.c
modules/demux/playlist/itml.c
modules/demux/playlist/m3u.c
modules/demux/playlist/pls.c
modules/demux/playlist/podcast.c
modules/demux/playlist/qtl.c
modules/demux/playlist/shoutcast.c
modules/demux/playlist/xspf.c
modules/gui/qt4/dialogs_provider.cpp
modules/services_discovery/bonjour.c
modules/services_discovery/podcast.c
modules/services_discovery/shout.c

index 10e9fe0..3060443 100644 (file)
@@ -416,8 +416,7 @@ static int Open( vlc_object_t * p_this )
                     free( psz_path );
                 }
                 msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
-                input_item_t *p_input = input_item_NewExt( p_demux, psz_ref
-                                                           , NULL, 0, NULL, 0, -1 );
+                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 );
                 vlc_gc_decref( p_input );
index 87b44b9..be33b78 100644 (file)
@@ -261,8 +261,7 @@ static int Demux( demux_t *p_demux )
                 if( !psz_elname ) return -1;
                 if( !strcmp( psz_elname, "entry" ) )
                 {
-                    p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
-                                                0, NULL, 0, -1 );
+                    p_input = input_item_New( p_demux, psz_mrl, psz_name );
                     if( psz_now )
                         input_item_SetNowPlaying( p_input, psz_now );
                     if( psz_genre )
index dac8629..7c36a79 100644 (file)
@@ -106,7 +106,7 @@ static int Demux( demux_t *p_demux )
     while( (psz_line = stream_ReadLine( p_demux->s )) )
     {
         char **ppsz_options = NULL;
-        int  i, i_options = 0;
+        int  i_options = 0;
         char *psz_name = NULL;
 
         if( !ParseLine( psz_line, &psz_name, &ppsz_options, &i_options ) )
@@ -116,16 +116,16 @@ static int Demux( demux_t *p_demux )
         }
 
         EnsureUTF8( psz_name );
-
-        p_input = input_item_NewExt( p_demux, "dvb://", psz_name, 0, NULL, 0, -1 );
-        for( i = 0; i< i_options; i++ )
-        {
+        for( int i = 0; i< i_options; i++ )
             EnsureUTF8( ppsz_options[i] );
-            input_item_AddOption( p_input, ppsz_options[i], VLC_INPUT_OPTION_TRUSTED );
-        }
+
+        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 );
         vlc_gc_decref( p_input );
-        while( i_options-- ) free( ppsz_options[i_options] );
+
+        while( i_options-- )
+            free( ppsz_options[i_options] );
         free( ppsz_options );
 
         free( psz_line );
index bd4537b..205b067 100644 (file)
@@ -202,8 +202,7 @@ static int Demux( demux_t *p_demux )
     }
     else
     {
-        p_input = input_item_NewExt( p_demux,
-                                    psz_url, psz_title, 0, NULL, 0, -1 );
+        p_input = input_item_New( p_demux, psz_url, psz_title );
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
                     p_input, _("Google Video"), _(type), "%s", field ) ; }
         SADD_INFO( "gvp_version", psz_version );
index 246bfba..a4ede1f 100644 (file)
@@ -95,7 +95,7 @@ static int Demux( demux_t *p_demux )
     psz_url = (char *)malloc( len+1 );
     snprintf( psz_url, len+1, "dvd://%s", p_demux->psz_path );
 
-    p_input = input_item_NewExt( p_demux, psz_url, psz_url, 0, NULL, 0, -1 );
+    p_input = input_item_New( p_demux, psz_url, psz_url );
     input_item_AddSubItem( p_current_input, p_input );
     vlc_gc_decref( p_input );
 
index 32a234b..53c7569 100644 (file)
@@ -380,8 +380,7 @@ static bool parse_track_dict COMPLEX_INTERFACE
             memmove( psz_uri + 7, psz_uri + 17, strlen( psz_uri ) - 9 );
             msg_Info( p_demux, "Adding '%s'", psz_uri );
 
-            p_new_input = input_item_NewExt( p_demux, psz_uri,
-                                            NULL, 0, NULL, 0, -1 );
+            p_new_input = input_item_New( p_demux, psz_uri, NULL );
             input_item_AddSubItem( p_input_item, p_new_input );
 
             /* add meta info */
index 09c99a0..9fe5f5f 100644 (file)
@@ -218,14 +218,12 @@ static int Demux( demux_t *p_demux )
             if( !psz_mrl ) goto error;
 
             p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
-                                        0, NULL, 0, i_duration );
+                                        i_options, ppsz_options, 0, i_duration );
 
             if ( psz_artist && *psz_artist )
                 input_item_SetArtist( p_input, psz_artist );
 
             input_item_AddSubItem( p_current_input, p_input );
-            for( int i = 0; i < i_options; i++ )
-                input_item_AddOption( p_input, ppsz_options[i], 0 );
             vlc_gc_decref( p_input );
             free( psz_mrl );
         }
index 56f8f1d..3c056b1 100644 (file)
@@ -159,8 +159,7 @@ static int Demux( demux_t *p_demux )
         {
             if( psz_mrl )
             {
-                p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
-                                            0, NULL, 0, -1 );
+                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 );
                 vlc_gc_decref( p_input );
@@ -215,7 +214,7 @@ static int Demux( demux_t *p_demux )
     /* Add last object */
     if( psz_mrl )
     {
-        p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,0, NULL, 0, -1 );
+        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 );
         vlc_gc_decref( p_input );
index eed0008..922c0a2 100644 (file)
@@ -291,8 +291,7 @@ static int Demux( demux_t *p_demux )
                         free( psz_elname );
                         return -1;
                     }
-                    p_input = input_item_NewExt( p_demux, psz_item_mrl,
-                                                psz_item_name, 0, NULL, 0, -1 );
+                    p_input = input_item_New( p_demux, psz_item_mrl, psz_item_name );
                     if( p_input == NULL ) break;
 #define ADD_INFO( info, field ) \
     if( field ) { input_item_AddInfo( p_input, \
index d947bab..d7dff7a 100644 (file)
@@ -349,8 +349,7 @@ static int Demux( demux_t *p_demux )
     }
     else
     {
-        p_input = input_item_NewExt( p_demux,
-                                psz_src, psz_moviename, 0, NULL, 0, -1 );
+        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 );
@@ -359,8 +358,7 @@ static int Demux( demux_t *p_demux )
         vlc_gc_decref( p_input );
         if( psz_qtnext )
         {
-            p_input = input_item_NewExt( p_demux,
-                                        psz_qtnext, NULL, 0, NULL, 0, -1 );
+            p_input = input_item_New( p_demux, psz_qtnext, NULL );
             input_item_AddSubItem( p_current_input, p_input );
             vlc_gc_decref( p_input );
         }
index c56c58d..1dbb4ce 100644 (file)
@@ -228,8 +228,7 @@ static int DemuxGenre( demux_t *p_demux )
                     if( asprintf( &psz_mrl, SHOUTCAST_BASE_URL "?genre=%s",
                              psz_name ) != -1 )
                     {
-                        p_input = input_item_NewExt( p_demux, psz_mrl,
-                                                    psz_name, 0, NULL, 0, -1 );
+                        p_input = input_item_New( p_demux, psz_mrl, psz_name );
                         input_item_CopyOptions( p_sys->p_current_input, p_input );
                         free( psz_mrl );
                         input_item_AddSubItem( p_sys->p_current_input, p_input );
@@ -399,13 +398,10 @@ static int DemuxStation( demux_t *p_demux )
                              psz_base, psz_id ) == -1 )
                             psz_mrl = NULL;
                     }
-                    p_input = input_item_NewExt( p_demux, psz_mrl,
-                                                psz_name , 0, NULL, 0, -1 );
+                    p_input = input_item_New( p_demux, psz_mrl, psz_name );
+                    input_item_CopyOptions( p_sys->p_current_input, p_input );
                     free( psz_mrl );
 
-                    input_item_CopyOptions( p_sys->p_current_input,
-                                                p_input );
-
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
                     p_input, _("Shoutcast"), _(type), "%s", field ) ; }
                     SADD_INFO( "Mime type", psz_mt );
index c42eece..ed1ed92 100644 (file)
@@ -416,11 +416,11 @@ static bool parse_track_node COMPLEX_INTERFACE
           {NULL,           UNKNOWN_CONTENT, {NULL} }
         };
 
-    input_item_t *p_new_input = input_item_NewExt( p_demux, NULL, NULL, 0, NULL, 0, -1 );
+    input_item_t *p_new_input = input_item_New( p_demux, NULL, NULL );
 
     if( !p_new_input )
     {
-        /* malloc has failed for input_item_NewExt, so bailout early */
+        /* malloc has failed for input_item_New, so bailout early */
         return false;
     }
 
index fb30054..febaf3e 100644 (file)
@@ -437,8 +437,7 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
     {
         QString mrl = dir.endsWith( "VIDEO_TS", Qt::CaseInsensitive ) ?
             "dvd://" : "directory://" + toNativeSeparators( dir );
-        input_item_t *p_input = input_item_NewExt( THEPL, qtu( mrl ),
-                              NULL, 0, NULL, 0, -1 );
+        input_item_t *p_input = input_item_New( THEPL, qtu( mrl ), NULL );
 
         /* FIXME: playlist_AddInput() can fail */
         playlist_AddInput( THEPL, p_input,
index 0cb7459..20f7bde 100644 (file)
@@ -175,7 +175,7 @@ static void resolve_callback(
 
         if( psz_uri != NULL )
         {
-            p_input = input_item_NewExt( p_sd, psz_uri, name, 0, NULL, 0, -1 );
+            p_input = input_item_New( p_sd, psz_uri, name );
             free( (void *)psz_uri );
         }
         if( p_input != NULL )
index 74fdc1a..e3e8295 100644 (file)
@@ -245,8 +245,7 @@ static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
             input_item_t *p_input;
             INSERT_ELEM( p_sys->ppsz_urls, p_sys->i_urls, p_sys->i_urls,
                          strdup( psz_urls ) );
-            p_input = input_item_NewExt( p_sd, psz_urls,
-                                        psz_urls, 0, NULL, 0, -1 );
+            p_input = input_item_New( p_sd, psz_urls, psz_urls );
             input_item_AddOption( p_input, "demux=podcast", VLC_INPUT_OPTION_TRUSTED );
             services_discovery_AddItem( p_sd, p_input, NULL /* no cat */ );
             vlc_gc_decref( p_input );
index b82fd64..7b7417b 100644 (file)
@@ -186,9 +186,7 @@ static input_item_t * CreateInputItemFromShoutItem( services_discovery_t *p_sd,
 {
     int i;
     /* Create the item */
-    input_item_t *p_input = input_item_NewExt( p_sd,
-                    p_item->psz_url, _(p_item->psz_name),
-                    0, NULL, 0, -1 );
+    input_item_t *p_input = input_item_New( p_sd, p_item->psz_url, _(p_item->psz_name) );
 
     /* Copy options */
     for( i = 0; p_item->ppsz_options[i] != NULL; i++ )