]> git.sesse.net Git - vlc/commitdiff
Force to specify options flags in input_item_New*.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 17 Jan 2009 17:37:14 +0000 (18:37 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 17 Jan 2009 18:23:40 +0000 (19:23 +0100)
It previously assumed TRUSTED.
No functionnal/security changes in this commit.

27 files changed:
include/vlc_input_item.h
modules/access/cdda.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/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/sgimb.c
modules/demux/playlist/shoutcast.c
modules/demux/playlist/xspf.c
modules/gui/qt4/dialogs_provider.cpp
modules/misc/lua/vlc.c
modules/services_discovery/bonjour.c
modules/services_discovery/podcast.c
modules/services_discovery/sap.c
modules/services_discovery/shout.c
src/control/media_list.c
src/input/item.c
src/playlist/item.c
src/playlist/loadsave.c
src/playlist/tree.c

index bfacb54aa27e73cae316b973459ac44605b57166..938cf121c2d4a3802be622cf15b70562c1313348 100644 (file)
@@ -177,9 +177,13 @@ VLC_EXPORT( char *, input_item_GetInfo, ( input_item_t *p_i, const char *psz_cat
 VLC_EXPORT( int, input_item_AddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) LIBVLC_FORMAT( 4, 5 ) );
 VLC_EXPORT( int, input_item_DelInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name ) );
 
-#define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, -1 )
-#define input_item_NewExt(a,b,c,d,e,f) __input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( input_item_t *, __input_item_NewExt, (vlc_object_t *, const char *, const char*, int, const char *const *, mtime_t i_duration )  );
-VLC_EXPORT( input_item_t *, input_item_NewWithType, ( vlc_object_t *, const char *, const char *e, int, const char *const *, mtime_t i_duration, int ) );
+#define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, 0, -1 )
+#define input_item_NewExt(a,b,c,d,e,f,g) __input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f,g)
+VLC_EXPORT( input_item_t *, __input_item_NewExt, (vlc_object_t *, const char *, const char*, int, const char *const *, unsigned, mtime_t i_duration )  );
+
+/**
+ * This function creates a new input_item_t with the provided informations.
+ */
+VLC_EXPORT( input_item_t *, input_item_NewWithType, ( vlc_object_t *, const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration, int i_type ) );
 
 #endif
index 03b3f3c3fb93ed032d1ac7fe491ec0d5a2958544..e6fd6fab8a8ded06b0f45cf7c144296453cc897d 100644 (file)
@@ -437,7 +437,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
 
         /* Create playlist items */
         p_input_item = input_item_NewWithType( VLC_OBJECT( p_access ),
-                                              psz_uri, psz_name, 0, NULL, -1,
+                                              psz_uri, psz_name, 0, NULL, 0, -1,
                                               ITEM_TYPE_DISC );
         input_item_CopyOptions( p_current, p_input_item );
         input_item_AddOption( p_input_item, psz_first, VLC_INPUT_OPTION_TRUSTED );
index 4154cb5c58597873fb48375c74017f239c20a713..10e9fe07a16a63288cc4b8e5f565570e09329065 100644 (file)
@@ -417,7 +417,7 @@ static int Open( vlc_object_t * p_this )
                 }
                 msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
                 input_item_t *p_input = input_item_NewExt( p_demux, psz_ref
-                                                           , NULL, 0, NULL, -1 );
+                                                           , NULL, 0, NULL, 0, -1 );
                 input_item_CopyOptions( p_current, p_input );
                 input_item_AddSubItem( p_current, p_input );
                 vlc_gc_decref( p_input );
index 53a3d26ef0bd1e606cdcea26ea78c9cf967dbe95..030c3410cd6d40b848021df56d32bd323b5b1d7f 100644 (file)
@@ -528,7 +528,8 @@ static int Demux( demux_t *p_demux )
                     char *psz_current_input_name = input_item_GetName( p_current_input );
                     if( asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : psz_current_input_name ) ) != -1 )
                     {
-                        p_entry = input_item_NewExt( p_demux, psz_href, psz_name, i_options, (const char * const *)ppsz_options, -1 );
+                        p_entry = input_item_NewExt( p_demux, psz_href, psz_name,
+                                                     i_options, (const char * const *)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
                         free( psz_name );
                         input_item_CopyOptions( p_current_input, p_entry );
                         while( i_options )
index c463c6518173a63635c583c20197233a1d7eadd9..87b44b931c55d4886fa5833627f52cbe3a626501 100644 (file)
@@ -262,7 +262,7 @@ static int Demux( demux_t *p_demux )
                 if( !strcmp( psz_elname, "entry" ) )
                 {
                     p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
-                                                0, NULL, -1 );
+                                                0, NULL, 0, -1 );
                     if( psz_now )
                         input_item_SetNowPlaying( p_input, psz_now );
                     if( psz_genre )
index 94d901ad731af022c37e8da042cdcbaf143ed087..dac8629494c108ff0e2bd21d2951c3517638231d 100644 (file)
@@ -117,7 +117,7 @@ static int Demux( demux_t *p_demux )
 
         EnsureUTF8( psz_name );
 
-        p_input = input_item_NewExt( p_demux, "dvb://", psz_name, 0, NULL, -1 );
+        p_input = input_item_NewExt( p_demux, "dvb://", psz_name, 0, NULL, 0, -1 );
         for( i = 0; i< i_options; i++ )
         {
             EnsureUTF8( ppsz_options[i] );
index e66b95fc4a934b284ec1915bbf106c362785ba8b..bd4537bba252f02613edecee28c2a0dd2b628929 100644 (file)
@@ -203,7 +203,7 @@ static int Demux( demux_t *p_demux )
     else
     {
         p_input = input_item_NewExt( p_demux,
-                                    psz_url, psz_title, 0, NULL, -1 );
+                                    psz_url, psz_title, 0, NULL, 0, -1 );
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
                     p_input, _("Google Video"), _(type), "%s", field ) ; }
         SADD_INFO( "gvp_version", psz_version );
index 058da357782e6e9283dbbcf56872ff1e3d89cb83..246bfbaaca30fd29acc0d528fbc7be15caf6c1e1 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, -1 );
+    p_input = input_item_NewExt( p_demux, psz_url, psz_url, 0, NULL, 0, -1 );
     input_item_AddSubItem( p_current_input, p_input );
     vlc_gc_decref( p_input );
 
index 44e8dd52763eb0ff9087d8d5559d72ee690b4e44..32a234b3f31832b82f57745f5cdd7f280638fb21 100644 (file)
@@ -381,7 +381,7 @@ static bool parse_track_dict COMPLEX_INTERFACE
             msg_Info( p_demux, "Adding '%s'", psz_uri );
 
             p_new_input = input_item_NewExt( p_demux, psz_uri,
-                                            NULL, 0, NULL, -1 );
+                                            NULL, 0, NULL, 0, -1 );
             input_item_AddSubItem( p_input_item, p_new_input );
 
             /* add meta info */
index 2f0bf7fa7e7fc5bea9996dbf6b5d2d761d1d0511..09c99a0fec2e008f15a83cbc147a06ace9aeea23 100644 (file)
@@ -218,7 +218,7 @@ 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, i_duration );
+                                        0, NULL, 0, i_duration );
 
             if ( psz_artist && *psz_artist )
                 input_item_SetArtist( p_input, psz_artist );
index 099f5c37484da2dab63a03df4f3727fb096a3a2e..56f8f1d84efb5277f367ee8550d808cb10c96411 100644 (file)
@@ -160,7 +160,7 @@ static int Demux( demux_t *p_demux )
             if( psz_mrl )
             {
                 p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
-                                            0, NULL, -1 );
+                                            0, NULL, 0, -1 );
                 input_item_CopyOptions( p_current_input, p_input );
                 input_item_AddSubItem( p_current_input, p_input );
                 vlc_gc_decref( p_input );
@@ -215,7 +215,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, -1 );
+        p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,0, NULL, 0, -1 );
         input_item_CopyOptions( p_current_input, p_input );
         input_item_AddSubItem( p_current_input, p_input );
         vlc_gc_decref( p_input );
index c33eb13393190a3ddaf50774c85c2ea98b096cb7..eed0008b6c676a7fc484162b287624d62a337e94 100644 (file)
@@ -292,7 +292,7 @@ static int Demux( demux_t *p_demux )
                         return -1;
                     }
                     p_input = input_item_NewExt( p_demux, psz_item_mrl,
-                                                psz_item_name, 0, NULL, -1 );
+                                                psz_item_name, 0, NULL, 0, -1 );
                     if( p_input == NULL ) break;
 #define ADD_INFO( info, field ) \
     if( field ) { input_item_AddInfo( p_input, \
index 778608765b92e00f1a5cb418fa816534fb32748a..d947bab8da7c4fccba90f3f73cf6b4b3a0afebe9 100644 (file)
@@ -350,7 +350,7 @@ static int Demux( demux_t *p_demux )
     else
     {
         p_input = input_item_NewExt( p_demux,
-                                psz_src, psz_moviename, 0, NULL, -1 );
+                                psz_src, psz_moviename, 0, NULL, 0, -1 );
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
                     p_input, "QuickTime Media Link", _(type), "%s", field ) ; }
         SADD_INFO( "href", psz_href );
@@ -360,7 +360,7 @@ static int Demux( demux_t *p_demux )
         if( psz_qtnext )
         {
             p_input = input_item_NewExt( p_demux,
-                                        psz_qtnext, NULL, 0, NULL, -1 );
+                                        psz_qtnext, NULL, 0, NULL, 0, -1 );
             input_item_AddSubItem( p_current_input, p_input );
             vlc_gc_decref( p_input );
         }
index da40f03309c467a7ea89804d7ce0c94bf128d077..c83e604297ec16e32df23f5e8da27df31da24a5b 100644 (file)
@@ -378,7 +378,7 @@ static int Demux ( demux_t *p_demux )
 
     p_child = input_item_NewWithType( VLC_OBJECT(p_demux), p_sys->psz_uri,
                       p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri,
-                      0, NULL, p_sys->i_duration, ITEM_TYPE_NET );
+                      0, NULL, 0, p_sys->i_duration, ITEM_TYPE_NET );
  
     if( !p_child )
     {
index d3686c13e2792db82897e81ce427c980398c885a..c56c58ddbbc58c3e916647d274c8944a2b489293 100644 (file)
@@ -229,7 +229,7 @@ static int DemuxGenre( demux_t *p_demux )
                              psz_name ) != -1 )
                     {
                         p_input = input_item_NewExt( p_demux, psz_mrl,
-                                                    psz_name, 0, NULL, -1 );
+                                                    psz_name, 0, NULL, 0, -1 );
                         input_item_CopyOptions( p_sys->p_current_input, p_input );
                         free( psz_mrl );
                         input_item_AddSubItem( p_sys->p_current_input, p_input );
@@ -400,7 +400,7 @@ static int DemuxStation( demux_t *p_demux )
                             psz_mrl = NULL;
                     }
                     p_input = input_item_NewExt( p_demux, psz_mrl,
-                                                psz_name , 0, NULL, -1 );
+                                                psz_name , 0, NULL, 0, -1 );
                     free( psz_mrl );
 
                     input_item_CopyOptions( p_sys->p_current_input,
index 852db24a7850b1594b0a7e549fb0843ae9506007..c42eece0552c849ce349f77f35dd31367021f0b6 100644 (file)
@@ -416,7 +416,7 @@ 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, -1 );
+    input_item_t *p_new_input = input_item_NewExt( p_demux, NULL, NULL, 0, NULL, 0, -1 );
 
     if( !p_new_input )
     {
@@ -737,7 +737,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
             return false;
         }
         p_new_input = input_item_NewWithType( VLC_OBJECT( p_demux ),
-                          "vlc://nop", psz_title, 0, NULL, -1,
+                          "vlc://nop", psz_title, 0, NULL, 0, -1,
                           ITEM_TYPE_DIRECTORY );
         if( p_new_input )
         {
index cde5e5f544b1123456bf9dd1a7a4bc6189275088..fb300548998c00e9cd1c451e4c5563b5209c6a22 100644 (file)
@@ -438,7 +438,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, -1 );
+                              NULL, 0, NULL, 0, -1 );
 
         /* FIXME: playlist_AddInput() can fail */
         playlist_AddInput( THEPL, p_input,
index 7e9c701ee42513ede3f78eba053cc639f83d208f..5f386fd697aa8d85f41f221640b00e0d79867726 100644 (file)
@@ -436,6 +436,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     p_input = input_item_NewExt( p_playlist, psz_path,
                                                 psz_name, i_options,
                                                 (const char **)ppsz_options,
+                                                VLC_INPUT_OPTION_TRUSTED,
                                                 i_duration );
                     lua_pop( L, 3 ); /* pop "path name item" */
                     /* playlist key item */
index 5c7f8405cd45dc2b651d473e025951ce8d4aa67d..0cb74593602987984748bccdaee1e670acc06cc8 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, -1 );
+            p_input = input_item_NewExt( p_sd, psz_uri, name, 0, NULL, 0, -1 );
             free( (void *)psz_uri );
         }
         if( p_input != NULL )
index f4dc5a297d2e51cf8a782f2e7cc4f81d4a4c2f59..74fdc1abf9ff906d615962a5af8e8a55d4d08a49 100644 (file)
@@ -246,7 +246,7 @@ static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
             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, -1 );
+                                        psz_urls, 0, NULL, 0, -1 );
             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 ebe2bf4c95ef142395ddfcc82412893709aa7471..6eda5808a67e8ef171790e41596117bfb73b93c9 100644 (file)
@@ -867,7 +867,7 @@ sap_announce_t *CreateAnnounce( services_discovery_t *p_sd, uint16_t i_hash,
     p_input = input_item_NewWithType( VLC_OBJECT(p_sd),
                                      p_sap->p_sdp->psz_uri,
                                      p_sdp->psz_sessionname,
-                                     0, NULL, -1, ITEM_TYPE_NET );
+                                     0, NULL, 0, -1, ITEM_TYPE_NET );
     p_sap->p_item = p_input;
     if( !p_input )
     {
index d74b2cb53190944b57916467c9d4981b139841d6..b82fd647f34eb7e6d4aefc38872b45d0a0923c31 100644 (file)
@@ -188,7 +188,7 @@ static input_item_t * CreateInputItemFromShoutItem( services_discovery_t *p_sd,
     /* Create the item */
     input_item_t *p_input = input_item_NewExt( p_sd,
                     p_item->psz_url, _(p_item->psz_name),
-                    0, NULL, -1 );
+                    0, NULL, 0, -1 );
 
     /* Copy options */
     for( i = 0; p_item->ppsz_options[i] != NULL; i++ )
index 2eae4971ab4c644dad93b4b111326464378f3af6..5b9d6f5ed8cee06b063000a5cc673e23991dea3b 100644 (file)
@@ -223,7 +223,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
     libvlc_media_t * p_md;
 
     p_input_item = input_item_NewExt( p_mlist->p_libvlc_instance->p_libvlc_int, psz_uri,
-                                _("Media Library"), 0, NULL, -1 );
+                                      _("Media Library"), 0, NULL, 0, -1 );
 
     if( !p_input_item )
     {
index d561522ab524b79058b65789417696ff15f4ba91..55a5b8fc491e20077807a53a63246bfa654433a9 100644 (file)
@@ -627,10 +627,11 @@ input_item_t *__input_item_NewExt( vlc_object_t *p_obj, const char *psz_uri,
                                   const char *psz_name,
                                   int i_options,
                                   const char *const *ppsz_options,
+                                  unsigned i_option_flags,
                                   mtime_t i_duration )
 {
     return input_item_NewWithType( p_obj, psz_uri, psz_name,
-                                  i_options, ppsz_options,
+                                  i_options, ppsz_options, i_option_flags,
                                   i_duration, ITEM_TYPE_UNKNOWN );
 }
 
@@ -639,6 +640,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
                                 const char *psz_name,
                                 int i_options,
                                 const char *const *ppsz_options,
+                                unsigned i_option_flags,
                                 mtime_t i_duration,
                                 int i_type )
 {
@@ -672,7 +674,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
     p_input->i_duration = i_duration;
 
     for( int i = 0; i < i_options; i++ )
-        input_item_AddOption( p_input, ppsz_options[i], VLC_INPUT_OPTION_TRUSTED );
+        input_item_AddOption( p_input, ppsz_options[i], i_option_flags );
     return p_input;
 }
 
index 780ebfc59fcc9c8ae0908802680c405367e5fd85..8c85d2a5caf128afbd75002338f01ec35cc78b62 100644 (file)
@@ -193,8 +193,9 @@ playlist_item_t * playlist_ItemNewWithType( playlist_t *p_playlist,
     input_item_t *p_input;
     if( psz_uri == NULL ) return NULL;
     p_input = input_item_NewWithType( VLC_OBJECT(p_playlist), psz_uri,
-                                     psz_name, i_options, ppsz_options,
-                                     i_duration, i_type );
+                                      psz_name,
+                                      i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED,
+                                      i_duration, i_type );
     return playlist_ItemNewFromInput( p_playlist, p_input );
 }
 
@@ -386,7 +387,7 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
 {
     int i_ret;
     input_item_t *p_input = input_item_NewExt( p_playlist, psz_uri, psz_name,
-                                              i_options, ppsz_options,
+                                              i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED,
                                               i_duration );
 
     i_ret = playlist_AddInput( p_playlist, p_input, i_mode, i_pos, b_playlist,
index bdde7dd85530d217ab2187addc6966bf5570ca50..2fc19c04a7b03bab00ece887ee71dd346b0a1274 100644 (file)
@@ -102,7 +102,7 @@ int playlist_Import( playlist_t *p_playlist, const char *psz_file )
         return VLC_EGENERIC;
 
     p_input = input_item_NewExt( p_playlist, psz_uri, psz_file,
-                                1, &psz_option, -1 );
+                                 1, &psz_option, VLC_INPUT_OPTION_TRUSTED, -1 );
     free( psz_uri );
 
     playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END,
@@ -162,8 +162,8 @@ int playlist_MLLoad( playlist_t *p_playlist )
     const char *const psz_option = "meta-file";
     /* that option has to be cleaned in input_item_subitem_added() */
     /* vlc_gc_decref() in the same function */
-    p_input = input_item_NewExt( p_playlist, psz_uri,
-                                _("Media Library"), 1, &psz_option, -1 );
+    p_input = input_item_NewExt( p_playlist, psz_uri, _("Media Library"),
+                                 1, &psz_option, VLC_INPUT_OPTION_TRUSTED, -1 );
     if( p_input == NULL )
         goto error;
 
index e6d23c98173c7f9f706df42cf145b990d9bd5a0f..ed16eb911c96f1270752d95fc53238c464502c1a 100644 (file)
@@ -67,7 +67,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
 
     if( !p_input )
         p_new_input = input_item_NewWithType( VLC_OBJECT(p_playlist), NULL,
-                                        psz_name, 0, NULL, -1, ITEM_TYPE_NODE );
+                                        psz_name, 0, NULL, 0, -1, ITEM_TYPE_NODE );
     p_item = playlist_ItemNewFromInput( p_playlist,
                                         p_input ? p_input : p_new_input );
     if( p_new_input )