]> git.sesse.net Git - vlc/commitdiff
include/vlc_playlist.h: Export playlist_DeleteInputInParent.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 17 Aug 2007 09:51:21 +0000 (09:51 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 17 Aug 2007 09:51:21 +0000 (09:51 +0000)
include/vlc_playlist.h
src/playlist/item.c

index 4d47c52a40aea29bf277e929240ac6f13bfc2932..a7c65e714be05a0a4288bfd3a53292d72330a4f6 100644 (file)
@@ -367,6 +367,7 @@ VLC_EXPORT( playlist_item_t *, __playlist_ItemNewFromInput, ( vlc_object_t *p_ob
 
 /*************************** Item deletion **************************/
 VLC_EXPORT( int,  playlist_DeleteFromInput, ( playlist_t *, int, vlc_bool_t ) );
+VLC_EXPORT( int,  playlist_DeleteInputInParent, ( playlist_t *, int, playlist_item_t *, vlc_bool_t ) );
 
 /*************************** Item fields accessors **************************/
 VLC_EXPORT( int, playlist_ItemSetName, (playlist_item_t *, const char * ) );
index e70c39b55a874db7321e8f1270f06705692ac03e..df17eebd67d02bcb807009823f653ab2248eff52 100644 (file)
@@ -172,6 +172,18 @@ static int DeleteFromInput( playlist_t *p_playlist, int i_input_id,
     return VLC_EGENERIC;
 }
 
+/** Remove an input item when it appears from a root playlist item */
+int playlist_DeleteInputInParent( playlist_t *p_playlist, int i_input_id,
+                                  playlist_item_t *p_root, vlc_bool_t b_locked )
+{
+    int i_ret;
+    if( !b_locked ) PL_LOCK;
+    i_ret = DeleteFromInput( p_playlist, i_input_id,
+                             p_root, VLC_TRUE );
+    if( !b_locked ) PL_UNLOCK;
+    return i_ret;
+}
+
 /** Remove an input item from ONELEVEL and CATEGORY */
 int playlist_DeleteFromInput( playlist_t *p_playlist, int i_input_id,
                               vlc_bool_t b_locked )