Commit 629dbd8a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove useless vlc_object parameter when creating an input item

parent c7d87dd2
......@@ -246,27 +246,26 @@ VLC_API void input_item_MergeInfos( input_item_t *, info_category_t * );
* XXX You may also use input_item_New or input_item_NewExt as they need
* less arguments.
*/
VLC_API 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 ) VLC_USED;
VLC_API input_item_t * input_item_NewWithType( 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 ) VLC_USED;
/**
* This function creates a new input_item_t with the provided information.
*
* Provided for convenience.
*/
VLC_API input_item_t * input_item_NewExt(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 ) VLC_USED;
#define input_item_NewExt(a,b,c,d,e,f,g) input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f,g)
VLC_API input_item_t * input_item_NewExt( const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration ) VLC_USED;
/**
* This function creates a new input_item_t with the provided information.
*
* Provided for convenience.
*/
#define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, 0, -1 )
#define input_item_New( a,b ) input_item_NewExt( a, b, 0, NULL, 0, -1 )
/**
* This function creates a new input_item_t as a copy of another.
*/
VLC_API input_item_t * input_item_Copy(vlc_object_t *, input_item_t * ) VLC_USED;
VLC_API input_item_t * input_item_Copy(input_item_t * ) VLC_USED;
/******************
......
......@@ -505,9 +505,8 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
/* Create playlist items */
const mtime_t i_duration = (int64_t)( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
p_input_item = input_item_NewWithType( VLC_OBJECT( p_access ),
psz_uri, psz_name, 0, NULL, 0, i_duration,
ITEM_TYPE_DISC );
p_input_item = input_item_NewWithType( psz_uri, psz_name, 0, NULL, 0,
i_duration, ITEM_TYPE_DISC );
input_item_CopyOptions( p_current, p_input_item );
input_item_AddOption( p_input_item, psz_first, VLC_INPUT_OPTION_TRUSTED );
input_item_AddOption( p_input_item, psz_last, VLC_INPUT_OPTION_TRUSTED );
......
......@@ -162,7 +162,7 @@ int MMSHOpen( access_t *p_access )
goto error;
}
/** \bug we do not autodelete here */
p_new_loc = input_item_New( p_access, psz_location, psz_location );
p_new_loc = input_item_New( psz_location, psz_location );
input_item_t *p_item = input_GetItem( p_input );
input_item_PostSubItem( p_item, p_new_loc );
......
......@@ -2115,7 +2115,7 @@ static input_item_t *parse_MRL( intf_thread_t *p_intf, char *psz_mrl )
/* Now create a playlist item */
if( psz_item_mrl )
{
p_item = input_item_New( p_intf, psz_item_mrl, NULL );
p_item = input_item_New( psz_item_mrl, NULL );
for( i = 0; i < i_options; i++ )
{
input_item_AddOption( p_item, ppsz_options[i], VLC_INPUT_OPTION_TRUSTED );
......
......@@ -421,7 +421,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_New( p_demux, psz_ref, NULL );
input_item_t *p_input = input_item_New( psz_ref, NULL );
input_item_CopyOptions( p_current, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
......
......@@ -475,7 +475,7 @@ static int Demux( demux_t *p_demux )
memcpy( psz_string, psz_backup, i_strlen );
psz_string[i_strlen] = '\0';
input_item_t *p_input;
p_input = input_item_New( p_demux, psz_string, psz_title_asx );
p_input = input_item_New( psz_string, psz_title_asx );
input_item_CopyOptions( p_current_input, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
......@@ -543,7 +543,7 @@ static int Demux( demux_t *p_demux )
if( asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : psz_current_input_name ) ) != -1 )
{
char *psz_mrl = ProcessMRL( psz_href, p_demux->p_sys->psz_prefix );
p_entry = input_item_NewExt( p_demux, psz_mrl, psz_name,
p_entry = input_item_NewExt( psz_mrl, psz_name,
i_options, (const char * const *)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_name );
free( psz_mrl );
......@@ -642,7 +642,7 @@ static int Demux( demux_t *p_demux )
char *psz_name = input_item_GetName( p_current_input );
char *psz_mrl = ProcessMRL( psz_href, p_demux->p_sys->psz_prefix );
p_entry = input_item_NewExt( p_demux, psz_mrl, psz_name,
p_entry = input_item_NewExt( psz_mrl, psz_name,
0, NULL, VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_mrl );
input_item_CopyOptions( p_current_input, p_entry );
......
......@@ -199,7 +199,7 @@ static int Demux( demux_t *p_demux )
// Read the element name
if( !strcmp( node, "entry" ) )
{
p_input = input_item_New( p_demux, psz_mrl, psz_title );
p_input = input_item_New( psz_mrl, psz_title );
if( psz_now )
input_item_SetNowPlaying( p_input, psz_now );
if( psz_genre )
......
......@@ -146,7 +146,7 @@ static int Demux( demux_t *p_demux )
}
}
p_input = input_item_NewExt( p_demux, psz_uri, psz_name,
p_input = input_item_NewExt( psz_uri, psz_name,
i_options, (const char**)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
......
......@@ -204,7 +204,7 @@ static int Demux( demux_t *p_demux )
}
else
{
p_input = input_item_New( p_demux, psz_url, psz_title );
p_input = input_item_New( 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 );
......
......@@ -113,7 +113,7 @@ static int Demux( demux_t *p_demux )
return 0;
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_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
......@@ -136,7 +136,7 @@ static int DemuxDVD_VR( demux_t *p_demux )
memcpy( psz_url + len, "VR_MOVIE.VRO", 13 );
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_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
......
......@@ -333,7 +333,7 @@ static bool parse_track_dict( demux_t *p_demux, input_item_node_t *p_input_node,
}
msg_Info( p_demux, "Adding '%s'", p_track->location );
p_new_input = input_item_New( p_demux, p_track->location, NULL );
p_new_input = input_item_New( p_track->location, NULL );
input_item_node_AppendItem( p_input_node, p_new_input );
/* add meta info */
......
......@@ -226,7 +226,7 @@ static int Demux( demux_t *p_demux )
goto error;
}
p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
p_input = input_item_NewExt( psz_mrl, psz_name,
i_options, ppsz_options, 0, i_duration );
free( psz_parse );
......
......@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux )
/* we found a new item, insert the previous */
if( psz_mrl )
{
p_input = input_item_New( p_demux, psz_mrl, psz_name );
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_current_input, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
......@@ -194,7 +194,7 @@ static int Demux( demux_t *p_demux )
/* Add last object */
if( psz_mrl )
{
p_input = input_item_New( p_demux, psz_mrl, psz_name );
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_current_input, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
......
......@@ -243,7 +243,7 @@ static int Demux( demux_t *p_demux )
goto error;
}
p_input = input_item_New( p_demux, psz_item_mrl, psz_item_name );
p_input = input_item_New( psz_item_mrl, psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_name );
......
......@@ -243,7 +243,7 @@ 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 );
p_input = input_item_New( 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 );
......@@ -252,7 +252,7 @@ static int Demux( demux_t *p_demux )
vlc_gc_decref( p_input );
if( psz_qtnext )
{
p_input = input_item_New( p_demux, psz_qtnext, NULL );
p_input = input_item_New( psz_qtnext, NULL );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
......
......@@ -326,7 +326,7 @@ static int Demux( demux_t *p_demux )
}
/* Create the input item and pump in all the options into playlist item */
p_input = input_item_NewExt( p_demux, psz_mrl, psz_title, i_options, ppsz_options, 0, i_duration );
p_input = input_item_NewExt( psz_mrl, psz_title, i_options, ppsz_options, 0, i_duration );
if( !EMPTY_STR( psz_artist ) ) input_item_SetArtist( p_input, psz_artist );
if( !EMPTY_STR( psz_author ) ) input_item_SetPublisher( p_input, psz_author );
......
......@@ -376,7 +376,7 @@ static int Demux ( demux_t *p_demux )
}
}
p_child = input_item_NewWithType( VLC_OBJECT(p_demux), p_sys->psz_uri,
p_child = input_item_NewWithType( p_sys->psz_uri,
p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri,
0, NULL, 0, p_sys->i_duration, ITEM_TYPE_NET );
......
......@@ -178,7 +178,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
psz_name ) != -1 )
{
input_item_t *p_input;
p_input = input_item_New( p_demux, psz_mrl, psz_name );
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
input_item_node_AppendItem( p_input_node, p_input );
......@@ -322,7 +322,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 );
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
......
......@@ -99,7 +99,7 @@ static int Demux( demux_t *p_demux )
*psz_parse = '\0';
psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix );
p_input = input_item_NewExt( p_demux, psz_uri, psz_uri,
p_input = input_item_NewExt( psz_uri, psz_uri,
0, NULL, 0, -1 );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
......
......@@ -357,7 +357,7 @@ static bool parse_track_node COMPLEX_INTERFACE
{NULL, UNKNOWN_CONTENT, {NULL} }
};
input_item_t *p_new_input = input_item_New( p_demux, NULL, NULL );
input_item_t *p_new_input = input_item_New( NULL, NULL );
input_item_node_t *p_new_node = input_item_node_Create( p_new_input );
if( !p_new_input )
......@@ -624,9 +624,9 @@ static bool parse_extension_node COMPLEX_INTERFACE
msg_Warn( p_demux, "<vlc:node> requires \"title\" attribute" );
return false;
}
p_new_input = input_item_NewWithType( VLC_OBJECT( p_demux ),
"vlc://nop", psz_title, 0, NULL, 0, -1,
ITEM_TYPE_DIRECTORY );
p_new_input = input_item_NewWithType( "vlc://nop", psz_title,
0, NULL, 0, -1,
ITEM_TYPE_DIRECTORY );
if( p_new_input )
{
p_input_node =
......
......@@ -165,7 +165,7 @@ static int Demux( demux_t *p_demux )
else if( !strncasecmp( psz_parse, "BR!", strlen( "BR!" ) ) )
{
/* create the input item */
input_item_t *p_input = input_item_NewExt( p_demux, psz_mrl,
input_item_t *p_input = input_item_NewExt( psz_mrl,
psz_title, 0, NULL, 0, i_duration );
input_item_node_AppendItem( p_subitems, p_input );
FREENULL( psz_mrl );
......
......@@ -135,7 +135,7 @@ void pl_row_activated_cb( GtkTreeView *tree_view , GtkTreePath *path,
gtk_tree_model_get_iter( model, &iter, path );
gtk_tree_model_get( model, &iter, 0, &filename, -1 );
p_input = input_item_New( p_intf, filename, NULL );
p_input = input_item_New( filename, NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, false );
vlc_gc_decref( p_input );
......@@ -172,7 +172,7 @@ void open_cb( GtkMenuItem *menuitem, gpointer user_data )
gtk_widget_destroy( dialog );
p_input = input_item_New( p_intf, psz_filename, NULL );
p_input = input_item_New( psz_filename, NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO,
PLAYLIST_END, true, false );
......@@ -207,8 +207,7 @@ void open_address_cb( GtkMenuItem *menuitem, gpointer user_data )
return;
}
p_input = input_item_New( p_intf,
gtk_entry_get_text( GTK_ENTRY( entry ) ),
p_input = input_item_New( gtk_entry_get_text( GTK_ENTRY( entry ) ),
NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO,
......@@ -224,7 +223,7 @@ void open_webcam_cb( GtkMenuItem *menuitem, gpointer user_data )
intf_thread_t *p_intf = (intf_thread_t *)user_data;
input_item_t *p_input;
p_input = input_item_New( p_intf, "v4l2://", NULL );
p_input = input_item_New( "v4l2://", NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO,
PLAYLIST_END, true, false );
......
......@@ -52,8 +52,7 @@
NSURL * o_url;
input_item_t *p_input;
p_input = input_item_New( p_playlist,
[o_urlString fileSystemRepresentation],
p_input = input_item_New( [o_urlString fileSystemRepresentation],
[[[NSFileManager defaultManager]
displayNameAtPath: o_urlString] UTF8String] );
/* FIXME: playlist_AddInput() can fail */
......
......@@ -1120,7 +1120,7 @@
o_uri = o_temp;
}
p_input = input_item_New( p_playlist, [o_uri fileSystemRepresentation], o_name ? [o_name UTF8String] : NULL );
p_input = input_item_New( [o_uri fileSystemRepresentation], o_name ? [o_name UTF8String] : NULL );
if( !p_input )
return NULL;
......
......@@ -1244,7 +1244,7 @@ static VLCWizard *_o_sharedInstance = nil;
NSString *tempString = [NSString stringWithFormat:
@"%@ (%i/%i)", _NS("Streaming/Transcoding Wizard"),
( x + 1 ), y];
input_item_t *p_input = input_item_New( p_playlist,
input_item_t *p_input = input_item_New(
[[[o_userSelections objectForKey:@"pathToStrm"]
objectAtIndex:x] UTF8String],
[tempString UTF8String] );
......
......@@ -361,7 +361,7 @@ void OpenDialog::finish( bool b_enqueue = false )
bool b_start = !i && !b_enqueue;
input_item_t *p_input;
p_input = input_item_New( p_intf, qtu( itemsMRL[i] ), NULL );
p_input = input_item_New( qtu( itemsMRL[i] ), NULL );
/* Insert options only for the first element.
We don't know how to edit that anyway. */
......
......@@ -508,7 +508,7 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
RecentsMRL::getInstance( p_intf )->addRecent( qfu(uri) );
input_item_t *p_input = input_item_New( THEPL, uri, NULL );
input_item_t *p_input = input_item_New( uri, NULL );
free( uri );
if( unlikely( p_input == NULL ) )
return;
......@@ -637,7 +637,7 @@ void DialogsProvider::streamingDialog( QWidget *parent,
/* Create Input */
input_item_t *p_input;
p_input = input_item_New( p_intf, qtu( mrl ), _("Streaming") );
p_input = input_item_New( qtu( mrl ), _("Streaming") );
/* Add normal Options */
for( int j = 0; j < options.size(); j++ )
......
......@@ -313,7 +313,7 @@ void Playtree::insertItems( VarTree& elem, const list<string>& files, bool start
if( !psz_uri )
continue;
input_item_t* pItem = input_item_New( m_pPlaylist, psz_uri, NULL );
input_item_t* pItem = input_item_New( psz_uri, NULL );
if( pItem )
{
int i_mode = PLAYLIST_APPEND;
......
......@@ -115,8 +115,7 @@ static int vlclua_sd_add_node( lua_State *L )
if( lua_isstring( L, -1 ) )
{
const char *psz_name = lua_tostring( L, -1 );
input_item_t *p_input = input_item_NewWithType( VLC_OBJECT( p_sd ),
"vlc://nop",
input_item_t *p_input = input_item_NewWithType( "vlc://nop",
psz_name, 0, NULL, 0,
-1, ITEM_TYPE_NODE );
lua_pop( L, 1 );
......@@ -166,7 +165,7 @@ static int vlclua_sd_add_item( lua_State *L )
int i_options = 0;
const char *psz_path = lua_tostring( L, -1 );
vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
input_item_t *p_input = input_item_NewExt( p_sd, psz_path, psz_path,
input_item_t *p_input = input_item_NewExt( psz_path, psz_path,
i_options,
(const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED, -1 );
......@@ -238,7 +237,7 @@ static int vlclua_node_add_subitem( lua_State *L )
const char *psz_path = lua_tostring( L, -1 );
vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
input_item_node_t *p_input_node = input_item_node_Create( *pp_node );
input_item_t *p_input = input_item_NewExt( p_sd, psz_path,
input_item_t *p_input = input_item_NewExt( psz_path,
psz_path, i_options,
(const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED, -1 );
......@@ -294,8 +293,7 @@ static int vlclua_node_add_node( lua_State *L )
{
const char *psz_name = lua_tostring( L, -1 );
input_item_node_t *p_input_node = input_item_node_Create( *pp_node );
input_item_t *p_input = input_item_NewWithType( VLC_OBJECT( p_sd ),
"vlc://nop",
input_item_t *p_input = input_item_NewWithType( "vlc://nop",
psz_name, 0, NULL, 0,
-1, ITEM_TYPE_NODE );
lua_pop( L, 1 );
......
......@@ -547,8 +547,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
vlclua_read_options( p_this, L, &i_options, &ppsz_options );
/* Create input item */
p_input = input_item_NewExt( p_playlist, psz_path,
psz_name, i_options,
p_input = input_item_NewExt( psz_path, psz_name, i_options,
(const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED,
i_duration );
......
......@@ -1359,9 +1359,7 @@ static int CreateInputItemFromMedia( media_library_t *p_ml,
ml_media_t *p_media )
{
playlist_t *p_pl = pl_Get( p_ml );
*pp_item = input_item_New( VLC_OBJECT( p_pl ),
p_media->psz_uri,
p_media->psz_title );
*pp_item = input_item_New( p_media->psz_uri, p_media->psz_title );
/* ITEM_TYPE_FILE ); */
if( !*pp_item )
return VLC_EGENERIC;
......
......@@ -480,8 +480,7 @@ static void ScanFiles( monitoring_thread_t *p_mon, int i_dir_id,
if( b_skip )
continue;
p_input = input_item_New( VLC_OBJECT(p_mon), psz_encoded_uri,
psz_entry );
p_input = input_item_New( psz_encoded_uri, psz_entry );
playlist_t* p_pl = pl_Get( p_mon );
preparsed_item_t* p_itemobject;
......
......@@ -176,7 +176,7 @@ static void resolve_callback(
if( psz_uri != NULL )
{
p_input = input_item_New( p_sd, psz_uri, name );
p_input = input_item_New( psz_uri, name );
free( psz_uri );
}
if( p_input != NULL )
......
......@@ -192,7 +192,7 @@ static void *Run( void *data )
char* psz_uri = make_URI( psz_dir, "file" );
input_item_t* p_root = input_item_New( p_sd, psz_uri, NULL );
input_item_t* p_root = input_item_New( psz_uri, NULL );
if( p_sys->i_type == Picture )
input_item_AddOption( p_root, "ignore-filetypes=ini,db,lnk,txt",
VLC_INPUT_OPTION_TRUSTED );
......@@ -269,7 +269,7 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
return VLC_EGENERIC;
char* psz_uri = make_URI( psz_file, "file" );
input_item_t* p_item = input_item_New( p_sd, psz_uri, NULL );
input_item_t* p_item = input_item_New( psz_uri, NULL );
if( p_sys->i_type == Picture )
{
......
......@@ -242,8 +242,7 @@ static void AddTrack( services_discovery_t *p_sd, LIBMTP_track_t *p_track )
msg_Err( p_sd, "Error adding %s, skipping it", p_track->filename );
return;
}
if( ( p_input = input_item_New( p_sd, psz_string,
p_track->title ) ) == NULL )
if( ( p_input = input_item_New( psz_string, p_track->title ) ) == NULL )
{
msg_Err( p_sd, "Error adding %s, skipping it", p_track->filename );
free( psz_string );
......
......@@ -311,7 +311,7 @@ static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
strdup( psz_urls ) );
input_item_t *p_input;
p_input = input_item_New( p_sd, psz_urls, psz_urls );
p_input = input_item_New( psz_urls, psz_urls );
input_item_AddOption( p_input, "demux=podcast", VLC_INPUT_OPTION_TRUSTED );
INSERT_ELEM( pp_new_items, i_new_items, i_new_items, p_input );
......@@ -374,7 +374,7 @@ static void ParseRequest( services_discovery_t *p_sd )
strdup( psz_request ) );
input_item_t *p_input;
p_input = input_item_New( p_sd, psz_request, psz_request );
p_input = input_item_New( psz_request, psz_request );
input_item_AddOption( p_input, "demux=podcast", VLC_INPUT_OPTION_TRUSTED );
INSERT_ELEM( p_sys->pp_items, p_sys->i_items, p_sys->i_items, p_input );
......
......@@ -827,10 +827,9 @@ sap_announce_t *CreateAnnounce( services_discovery_t *p_sd, uint16_t i_hash,
p_sap->p_sdp = p_sdp;
/* Released in RemoveAnnounce */
p_input = input_item_NewWithType( VLC_OBJECT(p_sd),
p_sap->p_sdp->psz_uri,
p_sdp->psz_sessionname,
0, NULL, 0, -1, ITEM_TYPE_NET );
p_input = input_item_NewWithType( p_sap->p_sdp->psz_uri,
p_sdp->psz_sessionname,
0, NULL, 0, -1, ITEM_TYPE_NET );
p_sap->p_item = p_input;
if( !p_input )
{
......
......@@ -162,8 +162,7 @@ static int AddDevice (services_discovery_t *sd, struct udev_device *dev)
if (mrl == NULL)
return 0; /* don't know if it was an error... */
char *name = p_sys->subsys->get_name (dev);
input_item_t *item = input_item_NewWithType (VLC_OBJECT (sd), mrl,
name ? name : mrl,
input_item_t *item = input_item_NewWithType (mrl, name ? name : mrl,
0, NULL, 0, -1,
p_sys->subsys->item_type);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
......
......@@ -890,7 +890,7 @@ void MediaServer::_buildPlaylist( Container* p_parent, input_item_node_t *p_inpu
{
Container* p_container = p_parent->getContainer( i );
input_item_t* p_input_item = input_item_New( _p_sd, "vlc://nop",
input_item_t* p_input_item = input_item_New( "vlc://nop",
p_container->getTitle() );
input_item_node_t *p_new_node =
input_item_node_AppendItem( p_input_node, p_input_item );
......@@ -903,8 +903,7 @@ void MediaServer::_buildPlaylist( Container* p_parent, input_item_node_t *p_inpu
{
Item* p_item = p_parent->getItem( i );
input_item_t* p_input_item = input_item_NewExt( _p_sd,
p_item->getResource(),
input_item_t* p_input_item = input_item_NewExt( p_item->getResource(),
p_item->getTitle(),
0,
NULL,
......@@ -966,8 +965,7 @@ bool MediaServerList::addServer( MediaServer* p_server )
msg_Dbg( _p_sd, "Adding server '%s' with uuid '%s'", p_server->getFriendlyName(), p_server->getUDN() );
p_input_item = input_item_New( _p_sd, "vlc://nop",
p_server->getFriendlyName() );
p_input_item = input_item_New( "vlc://nop", p_server->getFriendlyName() );
input_item_SetDescription( p_input_item, p_server->getUDN() );
......
......@@ -74,7 +74,7 @@ static int Open (vlc_object_t *obj)
continue;
mrl[8] = name[0] = letter;
item = input_item_NewWithType (VLC_OBJECT (sd), mrl, name,
item = input_item_NewWithType (mrl, name,
0, NULL, 0, -1, ITEM_TYPE_DISC);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
if (item == NULL)
......
......@@ -255,8 +255,7 @@ static struct app *AddApp (services_discovery_t *sd, xcb_window_t xid)
else
name = NULL;
input_item_t *item = input_item_NewWithType (VLC_OBJECT (sd), mrl,
name ? name : mrl,
input_item_t *item = input_item_NewWithType (mrl, name ? name : mrl,
0, NULL, 0, -1,
ITEM_TYPE_CARD /* FIXME */);
free (mrl);
......@@ -349,7 +348,7 @@ static void AddDesktop(services_discovery_t *sd)
{
input_item_t *item;
item = input_item_NewWithType (VLC_OBJECT (sd), "screen://", _("Desktop"),
item = input_item_NewWithType ("screen://", _("Desktop"),
0, NULL, 0, -1, ITEM_TYPE_CARD);
if (item == NULL)
return;
......
......@@ -294,7 +294,7 @@ libvlc_media_t *libvlc_media_new_location( libvlc_instance_t *p_instance,
input_item_t * p_input_item;
libvlc_media_t * p_md;
p_input_item = input_item_New( p_instance->p_libvlc_int, psz_mrl, NULL );
p_input_item = input_item_New( psz_mrl, NULL );
if (!p_input_item)
{
......@@ -342,7 +342,7 @@ libvlc_media_t * libvlc_media_new_as_node( libvlc_instance_t *p_instance,
input_item_t * p_input_item;
libvlc_media_t * p_md;
p_input_item = input_item_New( p_instance->p_libvlc_int, "vlc://nop", psz_name );
p_input_item = input_item_New( "vlc://nop", psz_name );
if (!p_input_item)
{
......
......@@ -250,8 +250,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
input_item_t * p_input_item;
libvlc_media_t * p_md;
p_input_item = input_item_NewExt(
p_mlist->p_libvlc_instance->p_libvlc_int, psz_uri,
p_input_item = input_item_NewExt( psz_uri,
_("Media Library"), 0, NULL, 0, -1 );
if( !p_input_item )
......
......@@ -38,39 +38,6 @@
static int GuessType( const input_item_t *p_item );
/** Stuff moved out of vlc_input.h -- FIXME: should probably not be inline
* anyway. */
static inline void input_item_Init( vlc_object_t *p_o, input_item_t *p_i )
{
memset( p_i, 0, sizeof(input_item_t) );
p_i->psz_name = NULL;
p_i->psz_uri = NULL;
TAB_INIT( p_i->i_es, p_i->es );
TAB_INIT( p_i->i_options, p_i->ppsz_options );
p_i->optflagv = NULL, p_i->optflagc = 0;
TAB_INIT( p_i->i_categories, p_i->pp_categories );
TAB_INIT( p_i->i_epg, p_i->pp_epg );
p_i->i_type = ITEM_TYPE_UNKNOWN;
p_i->b_fixed_name = true;
p_i->p_stats = NULL;
p_i->p_meta = NULL;
vlc_mutex_init( &p_i->lock );
vlc_event_manager_t * p_em = &p_i->event_manager;
vlc_event_manager_init( p_em, p_i );
vlc_event_manager_register_event_type( p_em, vlc_InputItemMetaChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemSubItemAdded );
vlc_event_manager_register_event_type( p_em, vlc_InputItemSubItemTreeAdded );
vlc_event_manager_register_event_type( p_em, vlc_InputItemDurationChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemPreparsedChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemNameChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemInfoChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemErrorWhenReadingChanged );
}
static inline void input_item_Clean( input_item_t *p_i )
{
int i;
......@@ -823,66 +790,82 @@ void input_item_SetEpgOffline( input_item_t *p_item )
vlc_event_send( &p_item->event_manager, &event );
}
#undef input_item_NewExt
input_item_t *input_item_NewExt( vlc_object_t *p_obj, const char *psz_uri,
input_item_t *input_item_NewExt( 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,
return input_item_NewWithType( psz_uri, psz_name,
i_options, ppsz_options, i_option_flags,
i_duration, ITEM_TYPE_UNKNOWN );
}