mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Accept also long description of format for snd_pcm_format_value()
This commit is contained in:
parent
78d836d7ea
commit
58f74152f5
1 changed files with 7 additions and 1 deletions
|
|
@ -1304,6 +1304,12 @@ snd_pcm_format_t snd_pcm_format_value(const char* name)
|
|||
return format;
|
||||
}
|
||||
}
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
|
||||
if (snd_pcm_format_descriptions[format] &&
|
||||
strcasecmp(name, snd_pcm_format_descriptions[format]) == 0) {
|
||||
return format;
|
||||
}
|
||||
}
|
||||
return SND_PCM_FORMAT_UNKNOWN;
|
||||
}
|
||||
|
||||
|
|
@ -5501,7 +5507,7 @@ int snd_pcm_slave_conf(snd_config_t *root, snd_config_t *conf,
|
|||
}
|
||||
f = snd_pcm_format_value(str);
|
||||
if (f == SND_PCM_FORMAT_UNKNOWN) {
|
||||
SNDERR("unknown format");
|
||||
SNDERR("unknown format %s", str);
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue