mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
Use pa_hashmap_remove_and_free() where appropriate
This commit is contained in:
parent
14e2553185
commit
eca082a93f
14 changed files with 29 additions and 84 deletions
|
|
@ -1324,13 +1324,9 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) {
|
|||
pa_assert_ctl_context();
|
||||
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
|
||||
|
||||
v = pa_hashmap_remove(i->volume_factor_items, key);
|
||||
|
||||
if (!v)
|
||||
if (pa_hashmap_remove_and_free(i->volume_factor_items, key) < 0)
|
||||
return -1;
|
||||
|
||||
volume_factor_entry_free(v);
|
||||
|
||||
switch (pa_hashmap_size(i->volume_factor_items)) {
|
||||
case 0:
|
||||
pa_cvolume_reset(&i->volume_factor, i->sample_spec.channels);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue