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 ...@@ -340,7 +340,7 @@ VLC_EXPORT( int, playlist_Export, ( playlist_t *p_playlist, const char *psz_nam
/*************************** Item creation **************************/ /*************************** 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 /** Create a new item, without adding it to the playlist
* \param p_obj a vlc object (anyone will do) * \param p_obj a vlc object (anyone will do)
...@@ -351,8 +351,6 @@ VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const ...@@ -351,8 +351,6 @@ VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const
#define playlist_ItemNew( a , b, c ) \ #define playlist_ItemNew( a , b, c ) \
playlist_ItemNewWithType( VLC_OBJECT(a) , b , c, 0, NULL, -1, 0 ) 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 **************************/ /*************************** Item deletion **************************/
VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, bool ) ); VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, bool ) );
......
...@@ -618,7 +618,7 @@ void OpenDialog::OnOk() ...@@ -618,7 +618,7 @@ void OpenDialog::OnOk()
{ {
bool b_start = !i && i_open_arg; bool b_start = !i && i_open_arg;
playlist_item_t *p_item = 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 */ /* Insert options */
while( i + 1 < i_args && pp_args[i + 1][0] == ':' ) while( i + 1 < i_args && pp_args[i + 1][0] == ':' )
......
...@@ -256,7 +256,6 @@ playlist_IsServicesDiscoveryLoaded ...@@ -256,7 +256,6 @@ playlist_IsServicesDiscoveryLoaded
playlist_ItemGetById playlist_ItemGetById
playlist_ItemGetByInput playlist_ItemGetByInput
playlist_ItemGetByInputId playlist_ItemGetByInputId
__playlist_ItemNewFromInput
playlist_ItemNewWithType playlist_ItemNewWithType
playlist_ItemSetName playlist_ItemSetName
playlist_ItemToNode playlist_ItemToNode
......
...@@ -153,26 +153,10 @@ static void uninstall_input_item_observer( playlist_item_t * p_item ) ...@@ -153,26 +153,10 @@ static void uninstall_input_item_observer( playlist_item_t * p_item )
/***************************************************************************** /*****************************************************************************
* Playlist item creation * Playlist item creation
*****************************************************************************/ *****************************************************************************/
playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj, playlist_item_t *playlist_ItemNewFromInput( 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( 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,
input_item_t *p_input ) input_item_t *p_input )
{ {
DECMALLOC_NULL( p_item, playlist_item_t ); DECMALLOC_NULL( p_item, playlist_item_t );
playlist_t *p_playlist = pl_Yield( p_obj );
p_item->p_input = p_input; p_item->p_input = p_input;
vlc_gc_incref( p_item->p_input ); vlc_gc_incref( p_item->p_input );
...@@ -187,11 +171,24 @@ playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj, ...@@ -187,11 +171,24 @@ playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj,
install_input_item_observer( p_item ); install_input_item_observer( p_item );
pl_Release( p_item->p_playlist );
return p_item; 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 * Playlist item destruction
***************************************************************************/ ***************************************************************************/
...@@ -453,9 +450,15 @@ int playlist_BothAddInput( playlist_t *p_playlist, ...@@ -453,9 +450,15 @@ int playlist_BothAddInput( playlist_t *p_playlist,
playlist_item_t *p_item_cat, *p_item_one, *p_up; playlist_item_t *p_item_cat, *p_item_one, *p_up;
int i_top; int i_top;
assert( p_input ); assert( p_input );
if( p_playlist->b_die ) return VLC_EGENERIC;
if( !b_locked ) PL_LOCK; if( !b_locked ) PL_LOCK;
if( !vlc_object_alive( p_playlist ) )
{
if( !b_locked ) PL_UNLOCK;
return VLC_EGENERIC;
}
/* Add to category */ /* Add to category */
p_item_cat = playlist_ItemNewFromInput( p_playlist, p_input ); p_item_cat = playlist_ItemNewFromInput( p_playlist, p_input );
if( p_item_cat == NULL ) return VLC_ENOMEM; if( p_item_cat == NULL ) return VLC_ENOMEM;
......
...@@ -64,6 +64,9 @@ struct playlist_fetcher_t ...@@ -64,6 +64,9 @@ struct playlist_fetcher_t
#define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a)) #define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a))
void __playlist_ThreadCreate ( vlc_object_t * ); void __playlist_ThreadCreate ( vlc_object_t * );
playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
input_item_t *p_input );
/* Creation/Deletion */ /* Creation/Deletion */
playlist_t *playlist_Create ( vlc_object_t * ); playlist_t *playlist_Create ( vlc_object_t * );
......
...@@ -67,7 +67,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist, ...@@ -67,7 +67,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
if( !p_input ) if( !p_input )
p_new_input = input_ItemNewWithType( VLC_OBJECT(p_playlist), NULL, p_new_input = input_ItemNewWithType( VLC_OBJECT(p_playlist), NULL,
psz_name, 0, NULL, -1, ITEM_TYPE_NODE ); 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 ); p_input ? p_input : p_new_input );
if( p_new_input ) if( p_new_input )
vlc_gc_decref( 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