Browse Source

use nanosleep instead of usleep

Waldemar Brodkorb 14 years ago
parent
commit
764fb0eb59
1 changed files with 23 additions and 0 deletions
  1. 23 0
      package/alsa-lib/patches/patch-src_pcm_pcm_shm_c

+ 23 - 0
package/alsa-lib/patches/patch-src_pcm_pcm_shm_c

@@ -0,0 +1,23 @@
+--- alsa-lib-1.0.22.orig/src/pcm/pcm_shm.c	2009-12-16 16:18:51.000000000 +0100
++++ alsa-lib-1.0.22/src/pcm/pcm_shm.c	2010-04-04 10:53:44.000000000 +0200
+@@ -482,15 +482,19 @@ static int snd_pcm_shm_drop(snd_pcm_t *p
+ 
+ static int snd_pcm_shm_drain(snd_pcm_t *pcm)
+ {
++	struct timespec ts;
+ 	snd_pcm_shm_t *shm = pcm->private_data;
+ 	volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
+ 	int err;
++	ts.tv_sec = 0;
++	ts.tv_nsec = 10000000;
++
+ 	do {
+ 		ctrl->cmd = SNDRV_PCM_IOCTL_DRAIN;
+ 		err = snd_pcm_shm_action(pcm);
+ 		if (err != -EAGAIN)
+ 			break;
+-		usleep(10000);
++		nanosleep(&ts, NULL);
+ 	} while (1);
+ 	if (err < 0)
+ 		return err;