mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Use defaults.pcm.file_format for the default file format of file plugin
Use "defaults.pcm.file_format" for the default file format of file plugin. It's set to "raw" as default for compatibility.
This commit is contained in:
parent
fe95bc237a
commit
87ae12214b
2 changed files with 20 additions and 2 deletions
|
|
@ -733,6 +733,17 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
|
|||
SNDERR("Unknown field %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!format) {
|
||||
snd_config_t *n;
|
||||
/* read defaults */
|
||||
if (snd_config_search(root, "defaults.pcm.file_format", &n) >= 0) {
|
||||
err = snd_config_get_string(n, &format);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid file format");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!slave) {
|
||||
SNDERR("slave is not defined");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue