mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04: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
|
|
@ -1840,8 +1840,7 @@ static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
nl = TRUE;
|
||||
}
|
||||
|
||||
if (card->active_profile)
|
||||
pa_strbuf_printf(buf, "set-card-profile %s %s\n", card->name, card->active_profile->name);
|
||||
pa_strbuf_printf(buf, "set-card-profile %s %s\n", card->name, card->active_profile->name);
|
||||
}
|
||||
|
||||
nl = FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue