changeset 27680:a529f3763afa

Make alsa resume after suspend to disk (would say 'file descriptor is in bad state' before this change)
author ranma
date Sat, 04 Oct 2008 15:03:10 +0000
parents 334c93f03d04
children 317f7890e2f9
files libao2/ao_alsa.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa.c	Sat Oct 04 13:07:31 2008 +0000
+++ b/libao2/ao_alsa.c	Sat Oct 04 15:03:10 2008 +0000
@@ -765,6 +765,10 @@
 {
     int err;
 
+    if (snd_pcm_state(alsa_handler) == SND_PCM_STATE_SUSPENDED) {
+        mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_PcmInSuspendModeTryingResume);
+        while ((err = snd_pcm_resume(alsa_handler)) == -EAGAIN) sleep(1);
+    }
     if (alsa_can_pause) {
         if ((err = snd_pcm_pause(alsa_handler, 0)) < 0)
         {