config/Block: add method GetPositiveValue()

Adds missing checks to several plugins.
This commit is contained in:
Max Kellermann
2018-01-02 17:22:25 +01:00
parent 7c5306a841
commit be65c7d5d0
10 changed files with 38 additions and 10 deletions

View File

@@ -74,7 +74,7 @@ fluidsynth_mpd_log_function(int level, char *message, gcc_unused void *data)
static bool
fluidsynth_init(const ConfigBlock &block)
{
sample_rate = block.GetBlockValue("sample_rate", 48000u);
sample_rate = block.GetPositiveValue("sample_rate", 48000u);
CheckSampleRate(sample_rate);
soundfont_path = block.GetBlockValue("soundfont",