mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
card: Ensure that there's always at least one profile.
In practice there is always at least one profile, and I don't think there will ever be cards without profiles. Therefore, I added assertions to pa_card_new() stating that the card new data must always contain at least one profile. Now a lot of code can be simplified, because it's guaranteed that the profiles hashmap and the active_profile field are always non-NULL.
This commit is contained in:
parent
1a6da64b16
commit
12af302ac7
9 changed files with 35 additions and 70 deletions
|
|
@ -502,7 +502,6 @@ int pa__init(pa_module *m) {
|
|||
if ((description = pa_proplist_gets(data.proplist, PA_PROP_DEVICE_DESCRIPTION)))
|
||||
pa_reserve_wrapper_set_application_device_name(reserve, description);
|
||||
|
||||
data.profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||
add_profiles(u, data.profiles, data.ports);
|
||||
|
||||
if (pa_hashmap_isempty(data.profiles)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue