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

playlist: use proper boolean instead of vlc_object_(kill|alive)

parent 72cae4dd
......@@ -107,7 +107,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
PL_ASSERT_LOCKED;
if( !vlc_object_alive( p_playlist ) )
if( pl_priv(p_playlist)->killed )
return VLC_EGENERIC;
if( playlist_IsEmpty( p_playlist ) && i_query != PLAYLIST_STOP )
......
......@@ -169,6 +169,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
VariablesInit( p_playlist );
vlc_mutex_init( &p->lock );
vlc_cond_init( &p->signal );
p->killed = false;
/* Initialise data structures */
pl_priv(p_playlist)->i_last_playlist_id = 0;
......
......@@ -82,6 +82,7 @@ typedef struct playlist_private_t
vlc_thread_t thread; /**< engine thread */
vlc_mutex_t lock; /**< dah big playlist global lock */
vlc_cond_t signal; /**< wakes up the playlist engine thread */
bool killed; /**< playlist is shutting down */
int i_last_playlist_id; /**< Last id to an item */
bool b_reset_currently_playing; /** Reset current item array */
......
......@@ -75,7 +75,7 @@ void playlist_Deactivate( playlist_t *p_playlist )
msg_Dbg( p_playlist, "deactivating the playlist" );
PL_LOCK;
vlc_object_kill( p_playlist );
p_sys->killed = true;
vlc_cond_signal( &p_sys->signal );
PL_UNLOCK;
......@@ -454,7 +454,7 @@ static int LoopInput( playlist_t *p_playlist )
if( !p_input )
return VLC_EGENERIC;
if( ( p_sys->request.b_request || !vlc_object_alive( p_playlist ) ) && !p_input->b_die )
if( ( p_sys->request.b_request || p_sys->killed ) && !p_input->b_die )
{
PL_DEBUG( "incoming request - stopping current input" );
input_Stop( p_input, true );
......@@ -512,7 +512,7 @@ static void LoopRequest( playlist_t *p_playlist )
const int i_status = p_sys->request.b_request ?
p_sys->request.i_status : p_sys->status.i_status;
if( i_status == PLAYLIST_STOPPED || !vlc_object_alive( p_playlist ) )
if( i_status == PLAYLIST_STOPPED || p_sys->killed )
{
p_sys->status.i_status = PLAYLIST_STOPPED;
......@@ -530,7 +530,7 @@ static void LoopRequest( playlist_t *p_playlist )
}
else
{
if( vlc_object_alive( p_playlist ) )
if( !p_sys->killed )
vlc_cond_wait( &p_sys->signal, &p_sys->lock );
}
return;
......@@ -563,7 +563,7 @@ static void *Thread ( void *data )
playlist_private_t *p_sys = pl_priv(p_playlist);
playlist_Lock( p_playlist );
while( vlc_object_alive( p_playlist ) || p_sys->p_input )
while( !p_sys->killed || p_sys->p_input )
{
/* FIXME: what's that ! */
if( p_sys->b_reset_currently_playing &&
......
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