conf: use getBoolBlockParam for block params, too
git-svn-id: https://svn.musicpd.org/mpd/trunk@6858 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
4a2122eaf4
commit
b2ae8da509
@ -84,9 +84,9 @@ static int alsa_initDriver(AudioOutput * audioOutput, ConfigParam * param)
|
|||||||
BlockParam *bp = getBlockParam(param, "device");
|
BlockParam *bp = getBlockParam(param, "device");
|
||||||
ad->device = bp ? xstrdup(bp->value) : xstrdup("default");
|
ad->device = bp ? xstrdup(bp->value) : xstrdup("default");
|
||||||
|
|
||||||
if ((bp = getBlockParam(param, "use_mmap")) &&
|
ad->useMmap = getBoolBlockParam(param, "use_mmap", 1);
|
||||||
!strcasecmp(bp->value, "yes"))
|
if (ad->useMmap == CONF_BOOL_UNSET)
|
||||||
ad->useMmap = 1;
|
ad->useMmap = 0;
|
||||||
if ((bp = getBlockParam(param, "buffer_time")))
|
if ((bp = getBlockParam(param, "buffer_time")))
|
||||||
ad->buffer_time = atoi(bp->value);
|
ad->buffer_time = atoi(bp->value);
|
||||||
if ((bp = getBlockParam(param, "period_time")))
|
if ((bp = getBlockParam(param, "period_time")))
|
||||||
|
@ -124,7 +124,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
|
|||||||
char *user;
|
char *user;
|
||||||
char *name;
|
char *name;
|
||||||
BlockParam *blockParam;
|
BlockParam *blockParam;
|
||||||
unsigned int public = 0;
|
unsigned int public;
|
||||||
|
|
||||||
sd = newShoutData();
|
sd = newShoutData();
|
||||||
|
|
||||||
@ -154,15 +154,9 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
|
|||||||
checkBlockParam("name");
|
checkBlockParam("name");
|
||||||
name = blockParam->value;
|
name = blockParam->value;
|
||||||
|
|
||||||
blockParam = getBlockParam(param, "public");
|
public = getBoolBlockParam(param, "public", 1);
|
||||||
if (blockParam) {
|
if (public == CONF_BOOL_UNSET)
|
||||||
if (0 == strcmp(blockParam->value, "yes")) {
|
public = 0;
|
||||||
public = 1;
|
|
||||||
} else if (strcmp(blockParam->value, "no")) {
|
|
||||||
FATAL("public \"%s\" is not \"yes\" or \"no\" at line "
|
|
||||||
"%i\n", param->value, param->line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blockParam = getBlockParam(param, "user");
|
blockParam = getBlockParam(param, "user");
|
||||||
if (blockParam)
|
if (blockParam)
|
||||||
|
Loading…
Reference in New Issue
Block a user