diff options
author | Clément Bœsch <ubitux@gmail.com> | 2011-03-07 21:49:26 +0100 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-04-20 04:22:53 +0300 |
commit | b17a1cf70c2666c0f8ea020c37350b178c62fc1a (patch) | |
tree | b21ccd61ba93f2851cbafbcbb06fcb44508d8223 /libao2 | |
parent | a2d28010cc7804cf4062f80eef5271c7e3eeb469 (diff) |
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).
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_alsa.c | 8 |
1 files 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); } /* |