summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2007-02-25 21:54:03 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2007-02-25 21:54:03 +0000
commit1c71b178c70bb1712667c4238d3ab3e4345a3c04 (patch)
treeec9cf64788cb156c063248e233878c4f441e9e51
parentc3d9a974c66f867a48a4b24d5d0ca485bbcdbeb9 (diff)
downloadxine-lib-1c71b178c70bb1712667c4238d3ab3e4345a3c04.tar.gz
xine-lib-1c71b178c70bb1712667c4238d3ab3e4345a3c04.tar.bz2
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
-rw-r--r--ChangeLog1
-rw-r--r--src/audio_out/audio_alsa_out.c5
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 <James@superbug.demon.co.uk>
*
*
- * $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);