# HG changeset patch # User reimar # Date 1351618114 0 # Node ID 4078c5a09d8e983c7ff0d2450e3df39bd8bcf962 # Parent 9b921155e030855f5b3ea19b485a86c35f8f7923 Try to make code a bit clearer. diff -r 9b921155e030 -r 4078c5a09d8e libao2/ao_alsa.c --- a/libao2/ao_alsa.c Tue Oct 30 17:14:28 2012 +0000 +++ b/libao2/ao_alsa.c Tue Oct 30 17:28:34 2012 +0000 @@ -787,13 +787,13 @@ mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_TryingToResetSoundcard); if ((res = snd_pcm_prepare(alsa_handler)) < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(res)); - return 0; break; } + res = 0; } } while (res == 0); - return res < 0 ? res : res * bytes_per_sample; + return res < 0 ? 0 : res * bytes_per_sample; } /* how many byes are free in the buffer */