Commit 2bb861e3 authored by Rafaël Carré's avatar Rafaël Carré

use vlc_object_* and PL_{UN}LOCK to simplify

parent 0e86a35f
......@@ -206,7 +206,7 @@ int playlist_AskForArtEnqueue( playlist_t *p_playlist,
p.p_item = p_item;
p.b_fetch_art = VLC_TRUE;
vlc_mutex_lock( &p_playlist->p_fetcher->object_lock );
vlc_object_lock( p_playlist->p_fetcher );
for( i = 0; i < p_playlist->p_fetcher->i_waiting &&
p_playlist->p_fetcher->p_waiting->b_fetch_art == VLC_TRUE;
i++ );
......@@ -214,8 +214,8 @@ int playlist_AskForArtEnqueue( playlist_t *p_playlist,
INSERT_ELEM( p_playlist->p_fetcher->p_waiting,
p_playlist->p_fetcher->i_waiting,
i, p );
vlc_cond_signal( &p_playlist->p_fetcher->object_wait );
vlc_mutex_unlock( &p_playlist->p_fetcher->object_lock );
vlc_object_signal_unlocked( p_playlist->p_fetcher );
vlc_obj_unlock( p_playlist->p_fetcher );
return VLC_SUCCESS;
}
......@@ -513,9 +513,9 @@ int playlist_PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
}
val.i_int = p_input->i_id;
vlc_mutex_unlock( &p_playlist->object_lock );
PL_UNLOCK;
var_Set( p_playlist, "playlist-current", val );
vlc_mutex_lock( &p_playlist->object_lock );
PL_LOCK;
return VLC_SUCCESS;
}
......@@ -696,10 +696,10 @@ void playlist_FetcherLoop( playlist_fetcher_t *p_obj )
vlc_gc_decref( p_item );
}
}
vlc_mutex_lock( &p_obj->object_lock );
vlc_object_lock( p_obj );
i_activity = var_GetInteger( p_playlist, "activity" );
if( i_activity < 0 ) i_activity = 0;
vlc_mutex_unlock( &p_obj->object_lock );
vlc_object_unlock( p_obj );
/* Sleep at least 1ms */
msleep( (i_activity+1) * 1000 );
}
......
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