]> git.sesse.net Git - vlc/blobdiff - include/vlc_playlist.h
Remove vlc_object_find for playlist from the core
[vlc] / include / vlc_playlist.h
index ac041fd480bcc5d060f52ecb2c554cba54f85276..6018b90d096442faa79cc7af8894f5c7c167afbf 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef _VLC_PLAYLIST_H_
 #define _VLC_PLAYLIST_H_
 
+#include <assert.h>
+
 /**
  *  \file
  *  This file contain structures and function prototypes related
@@ -208,6 +210,16 @@ int           playlist_ThreadDestroy  ( playlist_t * );
 #define PL_LOCK vlc_mutex_lock( &p_playlist->object_lock );
 #define PL_UNLOCK vlc_mutex_unlock( &p_playlist->object_lock );
 
+#define pl_Get( a ) a->p_libvlc->p_playlist
+#define pl_Yield( a ) __pl_Yield( VLC_OBJECT(a) )
+static inline playlist_t *__pl_Yield( vlc_object_t *p_this )
+{
+    assert( p_this->p_libvlc->p_playlist );
+    vlc_object_yield( p_this->p_libvlc->p_playlist );
+    return p_this->p_libvlc->p_playlist;
+}
+#define pl_Release(a) vlc_object_release( a->p_libvlc->p_playlist );
+
 /* Playlist control */
 #define playlist_Play(p) playlist_LockControl(p,PLAYLIST_PLAY )
 #define playlist_Pause(p) playlist_LockControl(p,PLAYLIST_PAUSE )