mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
alsa, bluetooth: fail if user-requested profile doesn't exist
If we can't fulfill the user request fully, I think we shouldn't fulfill it at all, to make it clear that the requested operation didn't succeed.
This commit is contained in:
parent
87f437d0dd
commit
59e76ca949
2 changed files with 14 additions and 4 deletions
|
|
@ -807,8 +807,15 @@ int pa__init(pa_module *m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL)))
|
||||
pa_card_new_data_set_profile(&data, profile);
|
||||
if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
|
||||
if (pa_hashmap_get(data.profiles, profile))
|
||||
pa_card_new_data_set_profile(&data, profile);
|
||||
else {
|
||||
pa_log("No such profile: %s", profile);
|
||||
pa_card_new_data_done(&data);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
u->card = pa_card_new(m->core, &data);
|
||||
pa_card_new_data_done(&data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue