More verbose output on error (wrong configuration)

This commit is contained in:
Jaroslav Kysela 2001-12-29 22:29:44 +00:00
parent 5912f56e53
commit f64ec1b32d

View file

@ -1508,10 +1508,14 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
#endif #endif
void *h; void *h;
if (snd_config_get_type(pcm_conf) != SND_CONFIG_TYPE_COMPOUND) { if (snd_config_get_type(pcm_conf) != SND_CONFIG_TYPE_COMPOUND) {
if (name) char *val;
SNDERR("Invalid type for PCM %s definition", name); id = NULL;
else snd_config_get_id(pcm_conf, &id);
SNDERR("Invalid type for PCM definition"); val = NULL;
snd_config_get_ascii(pcm_conf, &val);
SNDERR("Invalid type for PCM %s%sdefinition (id: %s, value: %s)", name ? name : "", name ? " " : "", id, val);
if (val)
free(val);
return -EINVAL; return -EINVAL;
} }
err = snd_config_search(pcm_conf, "type", &conf); err = snd_config_search(pcm_conf, "type", &conf);