]> git.sesse.net Git - vlc/commitdiff
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 10e9fe07a16a63288cc4b8e5f565570e09329065..30604431017a2ed44fa7fed6ed94abb4e77895ee 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 87b44b931c55d4886fa5833627f52cbe3a626501..be33b7826fb3b151669bb09d1fed8b6cdae19dc8 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 dac8629494c108ff0e2bd21d2951c3517638231d..7c36a796f23eace157e9f88c8fe280341f52562a 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 bd4537bba252f02613edecee28c2a0dd2b628929..205b067a4eeb273524a12ba0889caabe5d89d93a 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 246bfbaaca30fd29acc0d528fbc7be15caf6c1e1..a4ede1f6d809d20d7fd1f37fc97246da9367330f 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 32a234b3f31832b82f57745f5cdd7f280638fb21..53c7569023a3977410b41b61eb4f67b6e06ceef6 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 09c99a0fec2e008f15a83cbc147a06ace9aeea23..9fe5f5f0328a98c353c76a7fb2a6c13e0df460f5 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 56f8f1d84efb5277f367ee8550d808cb10c96411..3c056b1b907eba970619e0febe7f8ef725dc76ae 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 eed0008b6c676a7fc484162b287624d62a337e94..922c0a27251cfbf363c59aab13516d81374e7872 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 d947bab8da7c4fccba90f3f73cf6b4b3a0afebe9..d7dff7aa4d77d5ca449cb23899af8f62d73ff85c 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 c56c58ddbbc58c3e916647d274c8944a2b489293..1dbb4ce75337551a33601a88ed16778171494f09 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 c42eece0552c849ce349f77f35dd31367021f0b6..ed1ed924a83025f54ac0eda0d1ac0f21eebd143b 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 fb300548998c00e9cd1c451e4c5563b5209c6a22..febaf3e5dfa06db65d76df70753863bec8233741 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 0cb74593602987984748bccdaee1e670acc06cc8..20f7bdec3d7c9d1f16cc98944f3abd916144b258 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 74fdc1abf9ff906d615962a5af8e8a55d4d08a49..e3e829518aecd40b3941b400e7fd191a2f6bf9b2 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 b82fd647f34eb7e6d4aefc38872b45d0a0923c31..7b7417b79ff30ce1e7e5f58f404d596a122166bd 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++ )