Commit 03fc3695 authored by Francois Cartegnie's avatar Francois Cartegnie

ml: Ensure list lock is initiliazed when watch thread starts.

Some crashes occurs on start when processing the first append loop
at the unlock level.
parent 5d58894f
......@@ -93,6 +93,11 @@ int watch_Init( media_library_t *p_ml )
vlc_cond_init( &p_wt->cond );
vlc_mutex_init( &p_wt->lock );
/* Initialise item append queue */
vlc_mutex_init( &p_wt->item_append_queue_lock );
p_wt->item_append_queue = NULL;
p_wt->item_append_queue_count = 0;
if( vlc_clone( &p_wt->thread, watch_Thread, p_wt, VLC_THREAD_PRIORITY_LOW ) )
{
msg_Dbg( p_ml, "unable to launch the auto-updating thread" );
......@@ -111,11 +116,6 @@ int watch_Init( media_library_t *p_ml )
var_AddCallback( p_pl, "playlist-item-append", watch_PlaylistItemAppend, p_ml );
var_AddCallback( p_pl, "playlist-item-deleted", watch_PlaylistItemDeleted, p_ml );
/* Initialise item append queue */
vlc_mutex_init( &p_wt->item_append_queue_lock );
p_wt->item_append_queue = NULL;
p_wt->item_append_queue_count = 0;
return VLC_SUCCESS;
}
......
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