[Mplayer-cvslog] CVS: main/libao2 ao_alsa9.c,1.38,1.39
Attila Kinali CVS
attila at mplayerhq.hu
Sun Sep 21 11:49:28 CEST 2003
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv16880
Modified Files:
ao_alsa9.c
Log Message:
patch from Pierre Lombard <p_l at gmx.fr>
If the sound channel is already busy the async open fails and returns
-EBUSY. There's no need to try to open it synchronously as it will block
mplayer till the sound channel is released.
(Granted there's a very slight chance your sound device happen to be
freed between those two calls but it's not the common case).
The behavior is changed by this oneliner to match the ao_oss behavior
(disable sound if the sound device is busy).
Index: ao_alsa9.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa9.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- ao_alsa9.c 18 Aug 2003 13:39:07 -0000 1.38
+++ ao_alsa9.c 21 Sep 2003 09:49:05 -0000 1.39
@@ -503,7 +503,7 @@
//modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC
if ((err = snd_pcm_open(&alsa_handler, alsa_device, SND_PCM_STREAM_PLAYBACK, open_mode)) < 0)
{
- if (ao_noblock) {
+ if (err != -EBUSY && ao_noblock) {
printf("alsa-init: open in nonblock-mode failed, trying to open in block-mode\n");
if ((err = snd_pcm_open(&alsa_handler, alsa_device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
printf("alsa-init: playback open error: %s\n", snd_strerror(err));
More information about the MPlayer-cvslog
mailing list