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

ALSA: fix signaling race condition

start_date must be set with the lock held. Otherwise, the condition
statement inside the ALSAThread while() startup loop may fail.
Once signaled, start_date belongs to the ALSA thread, so locking is not
needed anymore.
parent 068f3682
......@@ -690,11 +690,11 @@ static void Play( aout_instance_t *p_aout )
p_aout->output.p_sys->b_playing = true;
/* get the playing date of the first aout buffer */
vlc_mutex_lock( &p_aout->output.p_sys->lock );
p_aout->output.p_sys->start_date =
aout_FifoFirstDate( p_aout, &p_aout->output.fifo );
/* wake up the audio output thread */
vlc_mutex_lock( &p_aout->output.p_sys->lock );
vlc_cond_signal( &p_aout->output.p_sys->wait );
vlc_mutex_unlock( &p_aout->output.p_sys->lock );
}
......
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