[vlc-devel] commit: playlist: Don't export playlist_ItemNewFromInput as it is not used, and don't use pl_Yield from here. (Pierre d'Herbemont )
git version control
git at videolan.org
Sun Jul 13 23:56:42 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jul 13 23:15:33 2008 +0200| [81b983e85e186ff417c079f726a47b38ce272714]
playlist: Don't export playlist_ItemNewFromInput as it is not used, and don't use pl_Yield from here.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=81b983e85e186ff417c079f726a47b38ce272714
---
include/vlc_playlist.h | 4 +--
modules/gui/wince/open.cpp | 2 +-
src/libvlccore.sym | 1 -
src/playlist/item.c | 43 ++++++++++++++++++++-----------------
src/playlist/playlist_internal.h | 3 ++
src/playlist/tree.c | 2 +-
6 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index d8f1e8e..4488ff5 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -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 ) );
diff --git a/modules/gui/wince/open.cpp b/modules/gui/wince/open.cpp
index aa49142..5d76b9b 100644
--- a/modules/gui/wince/open.cpp
+++ b/modules/gui/wince/open.cpp
@@ -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] == ':' )
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 3360dbd..b38b053 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -256,7 +256,6 @@ playlist_IsServicesDiscoveryLoaded
playlist_ItemGetById
playlist_ItemGetByInput
playlist_ItemGetByInputId
-__playlist_ItemNewFromInput
playlist_ItemNewWithType
playlist_ItemSetName
playlist_ItemToNode
diff --git a/src/playlist/item.c b/src/playlist/item.c
index fcde872..39f4ead 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -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;
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index f12f8c6..070de3f 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -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 * );
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index 3b583ee..f78c8db 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -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 );
More information about the vlc-devel
mailing list