patch-src_pcm_pcm_shm_c 636 B

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