fixed another shadow warning
git-svn-id: https://svn.musicpd.org/mpd/trunk@7307 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
70ba525144
commit
eb5d51c988
@ -59,7 +59,7 @@ static int audioOutputAo_initDriver(AudioOutput * audioOutput,
|
|||||||
ConfigParam * param)
|
ConfigParam * param)
|
||||||
{
|
{
|
||||||
ao_info *ai;
|
ao_info *ai;
|
||||||
char *dup;
|
char *duplicated;
|
||||||
char *stk1;
|
char *stk1;
|
||||||
char *stk2;
|
char *stk2;
|
||||||
char *n1;
|
char *n1;
|
||||||
@ -105,13 +105,13 @@ static int audioOutputAo_initDriver(AudioOutput * audioOutput,
|
|||||||
blockParam = getBlockParam(param, "options");
|
blockParam = getBlockParam(param, "options");
|
||||||
|
|
||||||
if (blockParam) {
|
if (blockParam) {
|
||||||
dup = xstrdup(blockParam->value);
|
duplicated = xstrdup(blockParam->value);
|
||||||
} else
|
} else
|
||||||
dup = xstrdup("");
|
duplicated = xstrdup("");
|
||||||
|
|
||||||
if (strlen(dup)) {
|
if (strlen(duplicated)) {
|
||||||
stk1 = NULL;
|
stk1 = NULL;
|
||||||
n1 = strtok_r(dup, ";", &stk1);
|
n1 = strtok_r(duplicated, ";", &stk1);
|
||||||
while (n1) {
|
while (n1) {
|
||||||
stk2 = NULL;
|
stk2 = NULL;
|
||||||
key = strtok_r(n1, "=", &stk2);
|
key = strtok_r(n1, "=", &stk2);
|
||||||
@ -136,7 +136,7 @@ static int audioOutputAo_initDriver(AudioOutput * audioOutput,
|
|||||||
n1 = strtok_r(NULL, ";", &stk1);
|
n1 = strtok_r(NULL, ";", &stk1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(dup);
|
free(duplicated);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -219,25 +219,25 @@ static int ao_play_deconst(ao_device *device, const void *output_samples,
|
|||||||
static int audioOutputAo_play(AudioOutput * audioOutput,
|
static int audioOutputAo_play(AudioOutput * audioOutput,
|
||||||
const char *playChunk, size_t size)
|
const char *playChunk, size_t size)
|
||||||
{
|
{
|
||||||
size_t send;
|
size_t chunk_size;
|
||||||
AoData *ad = (AoData *) audioOutput->data;
|
AoData *ad = (AoData *) audioOutput->data;
|
||||||
|
|
||||||
if (ad->device == NULL)
|
if (ad->device == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
send = (size_t)ad->writeSize > size
|
chunk_size = (size_t)ad->writeSize > size
|
||||||
? size : (size_t)ad->writeSize;
|
? size : (size_t)ad->writeSize;
|
||||||
|
|
||||||
if (ao_play_deconst(ad->device, playChunk, send) == 0) {
|
if (ao_play_deconst(ad->device, playChunk, chunk_size) == 0) {
|
||||||
audioOutputAo_error();
|
audioOutputAo_error();
|
||||||
ERROR("closing audio device due to write error\n");
|
ERROR("closing audio device due to write error\n");
|
||||||
audioOutputAo_closeDevice(audioOutput);
|
audioOutputAo_closeDevice(audioOutput);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
playChunk += send;
|
playChunk += chunk_size;
|
||||||
size -= send;
|
size -= chunk_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user