Commit deadb40d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: move pl_Get()

parent 33af9b68
......@@ -39,27 +39,6 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
* Playlist control
*****************************************************************************/
static vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
#undef pl_Get
playlist_t *pl_Get (vlc_object_t *obj)
{
playlist_t *pl;
libvlc_int_t *p_libvlc = obj->p_libvlc;
vlc_mutex_lock (&global_lock);
pl = libvlc_priv (p_libvlc)->p_playlist;
assert (pl != NULL);
if (!libvlc_priv (p_libvlc)->playlist_active)
{
playlist_Activate (pl);
libvlc_priv (p_libvlc)->playlist_active = true;
}
vlc_mutex_unlock (&global_lock);
return pl;
}
void playlist_Lock( playlist_t *pl )
{
vlc_mutex_lock( &pl_priv(pl)->lock );
......
......@@ -357,6 +357,26 @@ void playlist_Destroy( playlist_t *p_playlist )
vlc_object_release( p_playlist );
}
#undef pl_Get
playlist_t *pl_Get (vlc_object_t *obj)
{
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
libvlc_int_t *p_libvlc = obj->p_libvlc;
playlist_t *pl;
vlc_mutex_lock (&lock);
pl = libvlc_priv (p_libvlc)->p_playlist;
assert (pl != NULL);
if (!libvlc_priv (p_libvlc)->playlist_active)
{
playlist_Activate (pl);
libvlc_priv (p_libvlc)->playlist_active = true;
}
vlc_mutex_unlock (&lock);
return pl;
}
/** Get current playing input.
*/
input_thread_t * playlist_CurrentInput( playlist_t * p_playlist )
......
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