It previously assumed TRUSTED.
No functionnal/security changes in this commit.
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
/* 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 );
}
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 );
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 )
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 )
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] );
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 );
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 );
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 */
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 );
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 );
/* 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 );
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, \
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 );
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 );
}
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 )
{
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 );
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,
{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 )
{
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 )
{
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,
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 */
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 )
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 );
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 )
{
/* 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++ )
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 )
{
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 );
}
const char *psz_name,
int i_options,
const char *const *ppsz_options,
+ unsigned i_option_flags,
mtime_t i_duration,
int i_type )
{
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;
}
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 );
}
{
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,
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,
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;
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 )