From b17a1cf70c2666c0f8ea020c37350b178c62fc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Mon, 7 Mar 2011 21:49:26 +0100 Subject: ao_alsa: remove warning by simplifying error handling case Avoid a gcc warning about potentially uninitialized variable 'err' (there was no actual problem with the code). --- libao2/ao_alsa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 80537c3ded..1806a36d56 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -310,11 +310,11 @@ static int try_open_device(const char *device, int open_mode, int try_ac3) err = snd_pcm_open(&alsa_handler, ac3_device, SND_PCM_STREAM_PLAYBACK, open_mode); free(ac3_device); + if (!err) + return 0; } - 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); } /* -- cgit v1.2.3