Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
View Bug Activity | Format For Printing | XML | Clone This Bug
For libao to work properly the audio thread has to be created *after* the mutex and condition is created otherwise the sound thread has a chance to deadlock (as it was wont to do on my machine before I applied this patch :). I can't take credit for this fix as it was posted on one of the zsnes dev sites. As such, it's probably already upstream. But in lieu of an upstream version bump any time soon, I think this patch should be rolled in here as -r2. Patch below comes from http://board.zsnes.com/phpBB2/viewtopic.php?p=157699&sid=4ead2f9a94c153be8e85916ad6ac2f8b -------------------------------------------------------------------------- diff -ur zsnes-1.510/src/linux/audio.c zsnes-1.510-new/src/linux/audio.c --- zsnes-1.510/src/linux/audio.c 2007-01-09 20:19:12.000000000 -0500 +++ zsnes-1.510-new/src/linux/audio.c 2007-12-30 20:33:07.000000000 -0500 @@ -177,11 +177,7 @@ } else { - if (pthread_create(&audio_thread, 0, SoundThread_ao, 0)) - { - puts("pthread_create() failed."); - } - else if (pthread_mutex_init(&audio_mutex, 0)) + if (pthread_mutex_init(&audio_mutex, 0)) { puts("pthread_mutex_init() failed."); } @@ -189,6 +185,10 @@ { puts("pthread_cond_init() failed."); } + else if (pthread_create(&audio_thread, 0, SoundThread_ao, 0)) + { + puts("pthread_create() failed."); + } InitSampleControl(); }
Created an attachment (id=148077) [edit] Tested ebuild with new patch included
Created an attachment (id=148078) [edit] The patch
Fixed, thanks