Commit 81b983e8 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Don't export playlist_ItemNewFromInput as it is not used, and don't...

playlist: Don't export playlist_ItemNewFromInput as it is not used, and don't use pl_Yield from here.
parent 54a51559
......@@ -340,7 +340,7 @@ VLC_EXPORT( int, playlist_Export, ( playlist_t *p_playlist, const char *psz_nam
/*************************** Item creation **************************/
VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const char *,const char *, int , const char *const *, int, int) );
VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( playlist_t *,const char *,const char *, int , const char *const *, int, int) );
/** Create a new item, without adding it to the playlist
* \param p_obj a vlc object (anyone will do)
......@@ -351,8 +351,6 @@ VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const
#define playlist_ItemNew( a , b, c ) \
playlist_ItemNewWithType( VLC_OBJECT(a) , b , c, 0, NULL, -1, 0 )
#define playlist_ItemNewFromInput(a,b) __playlist_ItemNewFromInput(VLC_OBJECT(a),b)
VLC_EXPORT( playlist_item_t *, __playlist_ItemNewFromInput, ( vlc_object_t *p_obj,input_item_t *p_input ) );
/*************************** Item deletion **************************/
VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, bool ) );
......
......@@ -618,7 +618,7 @@ void OpenDialog::OnOk()
{
bool b_start = !i && i_open_arg;
playlist_item_t *p_item =
playlist_ItemNew( p_intf, pp_args[i], pp_args[i] );
playlist_ItemNew( p_playlist, pp_args[i], pp_args[i] );
/* Insert options */
while( i + 1 < i_args && pp_args[i + 1][0] == ':' )
......
......@@ -256,7 +256,6 @@ playlist_IsServicesDiscoveryLoaded
playlist_ItemGetById
playlist_ItemGetByInput
playlist_ItemGetByInputId
__playlist_ItemNewFromInput
playlist_ItemNewWithType
playlist_ItemSetName
playlist_ItemToNode
......
......@@ -153,26 +153,10 @@ static void uninstall_input_item_observer( playlist_item_t * p_item )
/*****************************************************************************
* Playlist item creation
*****************************************************************************/
playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj,
const char *psz_uri,
const char *psz_name,
int i_options,
const char *const *ppsz_options,
int i_duration, int i_type )
{
input_item_t *p_input;
if( psz_uri == NULL ) return NULL;
p_input = input_ItemNewWithType( p_obj, psz_uri,
psz_name, i_options, ppsz_options,
i_duration, i_type );
return playlist_ItemNewFromInput( p_obj, p_input );
}
playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj,
playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
input_item_t *p_input )
{
DECMALLOC_NULL( p_item, playlist_item_t );
playlist_t *p_playlist = pl_Yield( p_obj );
p_item->p_input = p_input;
vlc_gc_incref( p_item->p_input );
......@@ -187,11 +171,24 @@ playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj,
install_input_item_observer( p_item );
pl_Release( p_item->p_playlist );
return p_item;
}
playlist_item_t * playlist_ItemNewWithType( playlist_t *p_playlist,
const char *psz_uri,
const char *psz_name,
int i_options,
const char *const *ppsz_options,
int i_duration, int i_type )
{
input_item_t *p_input;
if( psz_uri == NULL ) return NULL;
p_input = input_ItemNewWithType( VLC_OBJECT(p_playlist), psz_uri,
psz_name, i_options, ppsz_options,
i_duration, i_type );
return playlist_ItemNewFromInput( p_playlist, p_input );
}
/***************************************************************************
* Playlist item destruction
***************************************************************************/
......@@ -453,9 +450,15 @@ int playlist_BothAddInput( playlist_t *p_playlist,
playlist_item_t *p_item_cat, *p_item_one, *p_up;
int i_top;
assert( p_input );
if( p_playlist->b_die ) return VLC_EGENERIC;
if( !b_locked ) PL_LOCK;
if( !vlc_object_alive( p_playlist ) )
{
if( !b_locked ) PL_UNLOCK;
return VLC_EGENERIC;
}
/* Add to category */
p_item_cat = playlist_ItemNewFromInput( p_playlist, p_input );
if( p_item_cat == NULL ) return VLC_ENOMEM;
......
......@@ -64,6 +64,9 @@ struct playlist_fetcher_t
#define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a))
void __playlist_ThreadCreate ( vlc_object_t * );
playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
input_item_t *p_input );
/* Creation/Deletion */
playlist_t *playlist_Create ( vlc_object_t * );
......
......@@ -67,7 +67,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
if( !p_input )
p_new_input = input_ItemNewWithType( VLC_OBJECT(p_playlist), NULL,
psz_name, 0, NULL, -1, ITEM_TYPE_NODE );
p_item = playlist_ItemNewFromInput( VLC_OBJECT(p_playlist),
p_item = playlist_ItemNewFromInput( p_playlist,
p_input ? p_input : p_new_input );
if( p_new_input )
vlc_gc_decref( p_new_input );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment