From 1c71b178c70bb1712667c4238d3ab3e4345a3c04 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sun, 25 Feb 2007 21:54:03 +0000 Subject: Fix race condition in alsa audio out driver. thanks Kirill Belokurov and Matthias Kretz CVS patchset: 8629 CVS date: 2007/02/25 21:54:03 --- ChangeLog | 1 + src/audio_out/audio_alsa_out.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99ca6996b..9d26fcacc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ xine-lib (1.1.5) XCB to talk with the server rather than libX11 (like new Kaffeine). The plugins are contributed by Christoph Pfister with the help of Vincent Torri, Jamey Sharp and Christophe Thommeret. + * Fix race condition in alsa audio out driver. xine-lib (1.1.4) * Mark string-type configuration items according to whether they're plain diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 24d597d50..1f3ec700d 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -26,7 +26,7 @@ * (c) 2001 James Courtier-Dutton * * - * $Id: audio_alsa_out.c,v 1.166 2007/02/20 00:04:50 dgp85 Exp $ + * $Id: audio_alsa_out.c,v 1.167 2007/02/25 21:54:04 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -162,7 +162,6 @@ static int my_snd_mixer_wait(snd_mixer_t *mixer, int timeout) { static void *ao_alsa_handle_event_thread(void *data) { alsa_driver_t *this = (alsa_driver_t *) data; - this->mixer.running = 1; do { if(my_snd_mixer_wait(this->mixer.handle, 333) > 0) { @@ -1292,6 +1291,8 @@ static void ao_alsa_mixer_init(ao_driver_t *this_gen) { if (send_events && found) { pthread_attr_t pth_attrs; struct sched_param pth_params; + + this->mixer.running = 1; pthread_attr_init(&pth_attrs); -- cgit v1.2.3