summaryrefslogtreecommitdiff
path: root/package/alsa-lib/patches/patch-src_pcm_pcm_shm_c
blob: decd44bc8a3f41a359543fec65926bb390ab6ee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;