changeset 33347:f60b1fd07712

Simplify code and avoid an incorrect "may be used initialized" gcc warning.
author reimar
date Sat, 07 May 2011 21:23:22 +0000
parents 780f64c1ac7e
children 62ab329812c9
files libao2/ao_alsa.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa.c	Sat May 07 21:15:13 2011 +0000
+++ b/libao2/ao_alsa.c	Sat May 07 21:23:22 2011 +0000
@@ -300,11 +300,10 @@
     err = snd_pcm_open(&alsa_handler, ac3_device, SND_PCM_STREAM_PLAYBACK,
 		       open_mode);
     free(ac3_device);
+    if (err >= 0)
+      return err;
   }
-  if (!try_ac3 || err < 0)
-    err = snd_pcm_open(&alsa_handler, device, SND_PCM_STREAM_PLAYBACK,
-		       open_mode);
-  return err;
+  return snd_pcm_open(&alsa_handler, device, SND_PCM_STREAM_PLAYBACK, open_mode);
 }
 
 /*