changeset 35200:4078c5a09d8e

Try to make code a bit clearer.
author reimar
date Tue, 30 Oct 2012 17:28:34 +0000
parents 9b921155e030
children 522fcb8ffb1b
files libao2/ao_alsa.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 */