comparison Plugins/Output/alsa/audio.c @ 1362:651327e12a3a trunk

[svn] - use of sleep() or usleep() in multi-thread program may cause 100% CPU usage because of signal distribution.
author yaz
date Fri, 30 Jun 2006 04:18:20 -0700
parents 7baea4fb20a4
children f12d7e208b43
comparison
equal deleted inserted replaced
1361:62a33367a6cb 1362:651327e12a3a
152 { 152 {
153 int err; 153 int err;
154 154
155 while ((err = snd_pcm_resume(alsa_pcm)) == -EAGAIN) 155 while ((err = snd_pcm_resume(alsa_pcm)) == -EAGAIN)
156 /* wait until suspend flag is released */ 156 /* wait until suspend flag is released */
157 sleep(1); 157 xmms_usleep(1000000);
158 if (err < 0) 158 if (err < 0)
159 { 159 {
160 g_warning("alsa_handle_error(): " 160 g_warning("alsa_handle_error(): "
161 "snd_pcm_resume() failed."); 161 "snd_pcm_resume() failed.");
162 return snd_pcm_prepare(alsa_pcm); 162 return snd_pcm_prepare(alsa_pcm);