conf: improved boolean config parameter handling from -ke

the force flag will issue FATAL() if an invalid value is
specified

git-svn-id: https://svn.musicpd.org/mpd/trunk@6857 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong
2007-09-05 23:59:33 +00:00
parent ac58dce7df
commit 4a2122eaf4
6 changed files with 68 additions and 34 deletions

View File

@@ -120,11 +120,10 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample,
static int mp3_plugin_init(void)
{
gaplessPlaybackEnabled = getBoolConfigParam(CONF_GAPLESS_MP3_PLAYBACK);
if (gaplessPlaybackEnabled == -1)
gaplessPlaybackEnabled = getBoolConfigParam(CONF_GAPLESS_MP3_PLAYBACK,
1);
if (gaplessPlaybackEnabled == CONF_BOOL_UNSET)
gaplessPlaybackEnabled = DEFAULT_GAPLESS_MP3_PLAYBACK;
else if (gaplessPlaybackEnabled < 0)
exit(EXIT_FAILURE);
return 1;
}