# HG changeset patch # User reimar # Date 1264616599 0 # Node ID 9fc779fd3721b35768f7075c37704cc8ceb01899 # Parent a97f9a9f30d10db1e3143e9e583ac44978274df1 Declare variable closer to where it is used. diff -r a97f9a9f30d1 -r 9fc779fd3721 libao2/ao_alsa.c --- a/libao2/ao_alsa.c Wed Jan 27 18:21:27 2010 +0000 +++ b/libao2/ao_alsa.c Wed Jan 27 18:23:19 2010 +0000 @@ -315,7 +315,6 @@ { unsigned int alsa_buffer_time = 500000; /* 0.5 s */ unsigned int alsa_fragcount = 16; - int open_mode; int err; int block; strarg_t device; @@ -469,15 +468,8 @@ mp_msg(MSGT_AO,MSGL_V,"alsa-init: using device %s\n", alsa_device); - //setting modes for block or nonblock-mode - if (!block) { - open_mode = SND_PCM_NONBLOCK; - } - else { - open_mode = 0; - } - if (!alsa_handler) { + int open_mode = block ? 0 : SND_PCM_NONBLOCK; int isac3 = AF_FORMAT_IS_AC3(format); //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0)