# HG changeset patch # User ranma # Date 1223132590 0 # Node ID a529f3763afa85c48920db4200c963e9bd45afe3 # Parent 334c93f03d048a9b483d9dd1ba5b701975d278e9 Make alsa resume after suspend to disk (would say 'file descriptor is in bad state' before this change) diff -r 334c93f03d04 -r a529f3763afa libao2/ao_alsa.c --- 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) {