[streaming] validate cfg for supported ffmpeg/mp3 sample_rates

$ fmpeg -h encoder=mp3
    ...
	Supported sample rates: 44100 48000 32000 22050 24000 16000 11025 12000 8000
	Supported sample formats: s32p fltp s16p
	Supported channel layouts: mono stereo
This commit is contained in:
whatdoineed2do/Ray 2019-09-13 10:49:42 +01:00 committed by ejurgensen
parent 8762891145
commit 7ccd32c354

View File

@ -631,7 +631,7 @@ streaming_init(void)
cfgsec = cfg_getsec(cfg, "streaming");
val = cfg_getint(cfgsec, "sample_rate");
if (val%44100 > 0 && val%48000 > 0)
if (val%11025 > 0 && val%12000 > 0 && val%8000)
DPRINTF(E_LOG, L_STREAMING, "non standard streaming sample_rate=%d, defaulting\n", val);
else
streaming_quality_out.sample_rate = val;