mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
sink, source: Always create a hashmap for ports.
Having the hashmap sometimes NULL requires a lot of checking here and there, so ensuring that the hashmap is always non-NULL simplifies the code.
This commit is contained in:
parent
21c6c70438
commit
1a6da64b16
10 changed files with 56 additions and 66 deletions
|
|
@ -121,12 +121,12 @@ static void find_sink_and_source(pa_card *card, pa_device_port *port, pa_sink **
|
|||
|
||||
if (port->is_output)
|
||||
PA_IDXSET_FOREACH(sink, card->sinks, state)
|
||||
if (sink->ports && port == pa_hashmap_get(sink->ports, port->name))
|
||||
if (port == pa_hashmap_get(sink->ports, port->name))
|
||||
break;
|
||||
|
||||
if (port->is_input)
|
||||
PA_IDXSET_FOREACH(source, card->sources, state)
|
||||
if (source->ports && port == pa_hashmap_get(source->ports, port->name))
|
||||
if (port == pa_hashmap_get(source->ports, port->name))
|
||||
break;
|
||||
|
||||
*si = sink;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue