diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-09 12:53:57 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-09 12:53:57 +0000 |
commit | b7fbcbae3fad7e96a0d690429c021cba2f0b4532 (patch) | |
tree | 5b4be7cfd39b71f459a41c650fab62f5f4f946fe /channels/chan_console.c | |
parent | 474f8606ea7d1060f8cf790040f19cff67afd206 (diff) |
Merge more changes from the resolve-shadow-warnings branch (henceforth known
as RSW since i am too lazy to keep typing it all out). This time a few of
the channels.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@136888 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_console.c')
-rw-r--r-- | channels/chan_console.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/channels/chan_console.c b/channels/chan_console.c index 6924ade3f..c9a59cab3 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -311,7 +311,7 @@ static int open_stream(struct console_pvt *pvt) .suggestedLatency = (1.0 / 50.0), /* 20 ms */ .device = paNoDevice, }; - PaDeviceIndex index, num_devices, def_input, def_output; + PaDeviceIndex idx, num_devices, def_input, def_output; if (!(num_devices = Pa_GetDeviceCount())) return res; @@ -319,23 +319,23 @@ static int open_stream(struct console_pvt *pvt) def_input = Pa_GetDefaultInputDevice(); def_output = Pa_GetDefaultOutputDevice(); - for (index = 0; - index < num_devices && (input_params.device == paNoDevice + for (idx = 0; + idx < num_devices && (input_params.device == paNoDevice || output_params.device == paNoDevice); - index++) + idx++) { - const PaDeviceInfo *dev = Pa_GetDeviceInfo(index); + const PaDeviceInfo *dev = Pa_GetDeviceInfo(idx); if (dev->maxInputChannels) { - if ( (index == def_input && !strcasecmp(pvt->input_device, "default")) || + if ( (idx == def_input && !strcasecmp(pvt->input_device, "default")) || !strcasecmp(pvt->input_device, dev->name) ) - input_params.device = index; + input_params.device = idx; } if (dev->maxOutputChannels) { - if ( (index == def_output && !strcasecmp(pvt->output_device, "default")) || + if ( (idx == def_output && !strcasecmp(pvt->output_device, "default")) || !strcasecmp(pvt->output_device, dev->name) ) - output_params.device = index; + output_params.device = idx; } } @@ -922,7 +922,7 @@ static char *cli_console_mute(struct ast_cli_entry *e, int cmd, struct ast_cli_a static char *cli_list_available(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { - PaDeviceIndex index, num, def_input, def_output; + PaDeviceIndex idx, num, def_input, def_output; if (cmd == CLI_INIT) { e->command = "console list available"; @@ -950,16 +950,16 @@ static char *cli_list_available(struct ast_cli_entry *e, int cmd, struct ast_cli def_input = Pa_GetDefaultInputDevice(); def_output = Pa_GetDefaultOutputDevice(); - for (index = 0; index < num; index++) { - const PaDeviceInfo *dev = Pa_GetDeviceInfo(index); + for (idx = 0; idx < num; idx++) { + const PaDeviceInfo *dev = Pa_GetDeviceInfo(idx); if (!dev) continue; ast_cli(a->fd, "=== ---------------------------------------------------------\n" "=== Device Name: %s\n", dev->name); if (dev->maxInputChannels) - ast_cli(a->fd, "=== ---> %sInput Device\n", (index == def_input) ? "Default " : ""); + ast_cli(a->fd, "=== ---> %sInput Device\n", (idx == def_input) ? "Default " : ""); if (dev->maxOutputChannels) - ast_cli(a->fd, "=== ---> %sOutput Device\n", (index == def_output) ? "Default " : ""); + ast_cli(a->fd, "=== ---> %sOutput Device\n", (idx == def_output) ? "Default " : ""); ast_cli(a->fd, "=== ---------------------------------------------------------\n===\n"); } |