Check for configuration strings that are given but turn out to be empty, issue a warning and ignore them.

This commit is contained in:
Mike Brady
2025-04-14 10:40:26 +01:00
parent a4807bc327
commit e05448aecc
9 changed files with 63 additions and 50 deletions
+4 -4
View File
@@ -1224,25 +1224,25 @@ static int init(int argc, char **argv) {
double dvalue;
/* Get the Output Device Name. */
if (config_lookup_string(config.cfg, "alsa.output_device", &str)) {
if (config_lookup_non_empty_string(config.cfg, "alsa.output_device", &str)) {
alsa_out_dev = (char *)str;
}
/* Get the Mixer Type setting. */
if (config_lookup_string(config.cfg, "alsa.mixer_type", &str)) {
if (config_lookup_non_empty_string(config.cfg, "alsa.mixer_type", &str)) {
inform("The alsa mixer_type setting is deprecated and has been ignored. "
"FYI, using the \"mixer_control_name\" setting automatically "
"chooses a hardware mixer.");
}
/* Get the Mixer Device Name. */
if (config_lookup_string(config.cfg, "alsa.mixer_device", &str)) {
if (config_lookup_non_empty_string(config.cfg, "alsa.mixer_device", &str)) {
alsa_mix_dev = (char *)str;
}
/* Get the Mixer Control Name. */
if (config_lookup_string(config.cfg, "alsa.mixer_control_name", &str)) {
if (config_lookup_non_empty_string(config.cfg, "alsa.mixer_control_name", &str)) {
alsa_mix_ctrl = (char *)str;
}