mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
idxset: Use pa_free_cb_t instead of pa_free2_cb_t
There were no users for the userdata pointer.
This commit is contained in:
parent
43e7868008
commit
061878b5a4
27 changed files with 81 additions and 119 deletions
|
|
@ -449,7 +449,7 @@ static void setting_free(pa_alsa_setting *s) {
|
||||||
pa_assert(s);
|
pa_assert(s);
|
||||||
|
|
||||||
if (s->options)
|
if (s->options)
|
||||||
pa_idxset_free(s->options, NULL, NULL);
|
pa_idxset_free(s->options, NULL);
|
||||||
|
|
||||||
pa_xfree(s->name);
|
pa_xfree(s->name);
|
||||||
pa_xfree(s->description);
|
pa_xfree(s->description);
|
||||||
|
|
@ -3289,10 +3289,10 @@ static void profile_free(pa_alsa_profile *p) {
|
||||||
pa_xstrfreev(p->output_mapping_names);
|
pa_xstrfreev(p->output_mapping_names);
|
||||||
|
|
||||||
if (p->input_mappings)
|
if (p->input_mappings)
|
||||||
pa_idxset_free(p->input_mappings, NULL, NULL);
|
pa_idxset_free(p->input_mappings, NULL);
|
||||||
|
|
||||||
if (p->output_mappings)
|
if (p->output_mappings)
|
||||||
pa_idxset_free(p->output_mappings, NULL, NULL);
|
pa_idxset_free(p->output_mappings, NULL);
|
||||||
|
|
||||||
pa_xfree(p);
|
pa_xfree(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1547,7 +1547,7 @@ static pa_bool_t sink_set_formats(pa_sink *s, pa_idxset *formats) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(u->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(u->formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
u->formats = pa_idxset_new(NULL, NULL);
|
u->formats = pa_idxset_new(NULL, NULL);
|
||||||
|
|
||||||
/* Note: the logic below won't apply if we're using software encoding.
|
/* Note: the logic below won't apply if we're using software encoding.
|
||||||
|
|
@ -2455,7 +2455,7 @@ static void userdata_free(struct userdata *u) {
|
||||||
pa_smoother_free(u->smoother);
|
pa_smoother_free(u->smoother);
|
||||||
|
|
||||||
if (u->formats)
|
if (u->formats)
|
||||||
pa_idxset_free(u->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(u->formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
if (u->rates)
|
if (u->rates)
|
||||||
pa_xfree(u->rates);
|
pa_xfree(u->rates);
|
||||||
|
|
|
||||||
|
|
@ -1498,9 +1498,9 @@ static void free_verb(pa_alsa_ucm_verb *verb) {
|
||||||
PA_LLIST_REMOVE(pa_alsa_ucm_device, verb->devices, di);
|
PA_LLIST_REMOVE(pa_alsa_ucm_device, verb->devices, di);
|
||||||
pa_proplist_free(di->proplist);
|
pa_proplist_free(di->proplist);
|
||||||
if (di->conflicting_devices)
|
if (di->conflicting_devices)
|
||||||
pa_idxset_free(di->conflicting_devices, NULL, NULL);
|
pa_idxset_free(di->conflicting_devices, NULL);
|
||||||
if (di->supported_devices)
|
if (di->supported_devices)
|
||||||
pa_idxset_free(di->supported_devices, NULL, NULL);
|
pa_idxset_free(di->supported_devices, NULL);
|
||||||
pa_xfree(di);
|
pa_xfree(di);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1552,7 +1552,7 @@ void pa_alsa_ucm_mapping_context_free(pa_alsa_ucm_mapping_context *context) {
|
||||||
dev->capture_mapping = NULL;
|
dev->capture_mapping = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(context->ucm_devices, NULL, NULL);
|
pa_idxset_free(context->ucm_devices, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context->ucm_modifiers) {
|
if (context->ucm_modifiers) {
|
||||||
|
|
@ -1563,7 +1563,7 @@ void pa_alsa_ucm_mapping_context_free(pa_alsa_ucm_mapping_context *context) {
|
||||||
mod->capture_mapping = NULL;
|
mod->capture_mapping = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(context->ucm_modifiers, NULL, NULL);
|
pa_idxset_free(context->ucm_modifiers, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -585,7 +585,6 @@ fail:
|
||||||
|
|
||||||
void pa__done(pa_module *m) {
|
void pa__done(pa_module *m) {
|
||||||
struct userdata *u;
|
struct userdata *u;
|
||||||
struct connection *c;
|
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
|
|
@ -595,12 +594,8 @@ void pa__done(pa_module *m) {
|
||||||
if (u->core_iface)
|
if (u->core_iface)
|
||||||
pa_dbusiface_core_free(u->core_iface);
|
pa_dbusiface_core_free(u->core_iface);
|
||||||
|
|
||||||
if (u->connections) {
|
if (u->connections)
|
||||||
while ((c = pa_idxset_steal_first(u->connections, NULL)))
|
pa_idxset_free(u->connections, (pa_free_cb_t) connection_free);
|
||||||
connection_free(c);
|
|
||||||
|
|
||||||
pa_idxset_free(u->connections, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This must not be called before the connections are freed, because if
|
/* This must not be called before the connections are freed, because if
|
||||||
* there are any connections left, they will emit the
|
* there are any connections left, they will emit the
|
||||||
|
|
|
||||||
|
|
@ -550,6 +550,7 @@ static void sink_input_kill_cb(pa_sink_input *i) {
|
||||||
pa_assert_se(o = i->userdata);
|
pa_assert_se(o = i->userdata);
|
||||||
|
|
||||||
pa_module_unload_request(o->userdata->module, TRUE);
|
pa_module_unload_request(o->userdata->module, TRUE);
|
||||||
|
pa_idxset_remove_by_data(o->userdata->outputs, o, NULL);
|
||||||
output_free(o);
|
output_free(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1107,6 +1108,7 @@ static pa_hook_result_t sink_unlink_hook_cb(pa_core *c, pa_sink *s, struct userd
|
||||||
if (!u->automatic)
|
if (!u->automatic)
|
||||||
u->unlinked_slaves = pa_strlist_prepend(u->unlinked_slaves, s->name);
|
u->unlinked_slaves = pa_strlist_prepend(u->unlinked_slaves, s->name);
|
||||||
|
|
||||||
|
pa_idxset_remove_by_data(u->outputs, o, NULL);
|
||||||
output_free(o);
|
output_free(o);
|
||||||
|
|
||||||
return PA_HOOK_OK;
|
return PA_HOOK_OK;
|
||||||
|
|
@ -1368,7 +1370,6 @@ fail:
|
||||||
|
|
||||||
void pa__done(pa_module*m) {
|
void pa__done(pa_module*m) {
|
||||||
struct userdata *u;
|
struct userdata *u;
|
||||||
struct output *o;
|
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
|
|
@ -1386,12 +1387,8 @@ void pa__done(pa_module*m) {
|
||||||
if (u->sink_state_changed_slot)
|
if (u->sink_state_changed_slot)
|
||||||
pa_hook_slot_free(u->sink_state_changed_slot);
|
pa_hook_slot_free(u->sink_state_changed_slot);
|
||||||
|
|
||||||
if (u->outputs) {
|
if (u->outputs)
|
||||||
while ((o = pa_idxset_first(u->outputs, NULL)))
|
pa_idxset_free(u->outputs, (pa_free_cb_t) output_free);
|
||||||
output_free(o);
|
|
||||||
|
|
||||||
pa_idxset_free(u->outputs, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (u->sink)
|
if (u->sink)
|
||||||
pa_sink_unlink(u->sink);
|
pa_sink_unlink(u->sink);
|
||||||
|
|
|
||||||
|
|
@ -1699,7 +1699,7 @@ void pa__done(pa_module*m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->subscribed)
|
if (u->subscribed)
|
||||||
pa_idxset_free(u->subscribed, NULL, NULL);
|
pa_idxset_free(u->subscribed, NULL);
|
||||||
|
|
||||||
pa_xfree(u);
|
pa_xfree(u);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,7 @@ static struct perportentry* perportentry_new(pa_bool_t add_pcm_format) {
|
||||||
static void perportentry_free(struct perportentry* e) {
|
static void perportentry_free(struct perportentry* e) {
|
||||||
pa_assert(e);
|
pa_assert(e);
|
||||||
|
|
||||||
pa_idxset_free(e->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(e->formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
pa_xfree(e);
|
pa_xfree(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1151,7 +1151,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
|
||||||
e = perportentry_new(FALSE);
|
e = perportentry_new(FALSE);
|
||||||
else {
|
else {
|
||||||
/* Clean out any saved formats */
|
/* Clean out any saved formats */
|
||||||
pa_idxset_free(e->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(e->formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
e->formats = pa_idxset_new(NULL, NULL);
|
e->formats = pa_idxset_new(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1338,7 +1338,7 @@ void pa__done(pa_module*m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->subscribed)
|
if (u->subscribed)
|
||||||
pa_idxset_free(u->subscribed, NULL, NULL);
|
pa_idxset_free(u->subscribed, NULL);
|
||||||
|
|
||||||
pa_xfree(u);
|
pa_xfree(u);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,23 +283,17 @@ fail:
|
||||||
|
|
||||||
void pa__done(pa_module *m) {
|
void pa__done(pa_module *m) {
|
||||||
struct userdata* u;
|
struct userdata* u;
|
||||||
char *role;
|
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
if (!(u = m->userdata))
|
if (!(u = m->userdata))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (u->trigger_roles) {
|
if (u->trigger_roles)
|
||||||
while ((role = pa_idxset_steal_first(u->trigger_roles, NULL)))
|
pa_idxset_free(u->trigger_roles, pa_xfree);
|
||||||
pa_xfree(role);
|
|
||||||
pa_idxset_free(u->trigger_roles, NULL, NULL);
|
if (u->cork_roles)
|
||||||
}
|
pa_idxset_free(u->cork_roles, pa_xfree);
|
||||||
if (u->cork_roles) {
|
|
||||||
while ((role = pa_idxset_steal_first(u->cork_roles, NULL)))
|
|
||||||
pa_xfree(role);
|
|
||||||
pa_idxset_free(u->cork_roles, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (u->sink_input_put_slot)
|
if (u->sink_input_put_slot)
|
||||||
pa_hook_slot_free(u->sink_input_put_slot);
|
pa_hook_slot_free(u->sink_input_put_slot);
|
||||||
|
|
|
||||||
|
|
@ -286,28 +286,23 @@ fail:
|
||||||
void pa__done(pa_module *m) {
|
void pa__done(pa_module *m) {
|
||||||
struct userdata* u;
|
struct userdata* u;
|
||||||
pa_sink_input *i;
|
pa_sink_input *i;
|
||||||
char *role;
|
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
if (!(u = m->userdata))
|
if (!(u = m->userdata))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (u->trigger_roles) {
|
if (u->trigger_roles)
|
||||||
while ((role = pa_idxset_steal_first(u->trigger_roles, NULL)))
|
pa_idxset_free(u->trigger_roles, pa_xfree);
|
||||||
pa_xfree(role);
|
|
||||||
pa_idxset_free(u->trigger_roles, NULL, NULL);
|
if (u->ducking_roles)
|
||||||
}
|
pa_idxset_free(u->ducking_roles, pa_xfree);
|
||||||
if (u->ducking_roles) {
|
|
||||||
while ((role = pa_idxset_steal_first(u->ducking_roles, NULL)))
|
|
||||||
pa_xfree(role);
|
|
||||||
pa_idxset_free(u->ducking_roles, NULL, NULL);
|
|
||||||
}
|
|
||||||
if (u->ducked_inputs) {
|
if (u->ducked_inputs) {
|
||||||
while ((i = pa_idxset_steal_first(u->ducked_inputs, NULL)))
|
while ((i = pa_idxset_steal_first(u->ducked_inputs, NULL)))
|
||||||
pa_sink_input_remove_volume_factor(i, u->name);
|
pa_sink_input_remove_volume_factor(i, u->name);
|
||||||
|
|
||||||
pa_idxset_free(u->ducked_inputs, NULL, NULL);
|
pa_idxset_free(u->ducked_inputs, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->sink_input_put_slot)
|
if (u->sink_input_put_slot)
|
||||||
|
|
|
||||||
|
|
@ -2549,7 +2549,7 @@ void pa__done(pa_module*m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->subscribed)
|
if (u->subscribed)
|
||||||
pa_idxset_free(u->subscribed, NULL, NULL);
|
pa_idxset_free(u->subscribed, NULL);
|
||||||
|
|
||||||
pa_xfree(u);
|
pa_xfree(u);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,6 @@ void pa_format_info_free(pa_format_info *f) {
|
||||||
pa_xfree(f);
|
pa_xfree(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_format_info_free2(pa_format_info *f, void *userdata) {
|
|
||||||
pa_format_info_free(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
int pa_format_info_valid(const pa_format_info *f) {
|
int pa_format_info_valid(const pa_format_info *f) {
|
||||||
return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
|
return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,8 +305,6 @@ void pa_ext_device_manager_command(pa_context *c, uint32_t tag, pa_tagstruct *t)
|
||||||
void pa_ext_device_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
|
void pa_ext_device_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
|
||||||
void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
|
void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
|
||||||
|
|
||||||
void pa_format_info_free2(pa_format_info *f, void *userdata);
|
|
||||||
|
|
||||||
pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m);
|
pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -233,9 +233,9 @@ void pa_card_free(pa_card *c) {
|
||||||
pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
|
pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->sinks));
|
pa_assert(pa_idxset_isempty(c->sinks));
|
||||||
pa_idxset_free(c->sinks, NULL, NULL);
|
pa_idxset_free(c->sinks, NULL);
|
||||||
pa_assert(pa_idxset_isempty(c->sources));
|
pa_assert(pa_idxset_isempty(c->sources));
|
||||||
pa_idxset_free(c->sources, NULL, NULL);
|
pa_idxset_free(c->sources, NULL);
|
||||||
|
|
||||||
pa_hashmap_free(c->ports, (pa_free_cb_t) pa_device_port_unref);
|
pa_hashmap_free(c->ports, (pa_free_cb_t) pa_device_port_unref);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,9 +103,9 @@ void pa_client_free(pa_client *c) {
|
||||||
pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CLIENT|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
|
pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CLIENT|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->sink_inputs));
|
pa_assert(pa_idxset_isempty(c->sink_inputs));
|
||||||
pa_idxset_free(c->sink_inputs, NULL, NULL);
|
pa_idxset_free(c->sink_inputs, NULL);
|
||||||
pa_assert(pa_idxset_isempty(c->source_outputs));
|
pa_assert(pa_idxset_isempty(c->source_outputs));
|
||||||
pa_idxset_free(c->source_outputs, NULL, NULL);
|
pa_idxset_free(c->source_outputs, NULL);
|
||||||
|
|
||||||
pa_proplist_free(c->proplist);
|
pa_proplist_free(c->proplist);
|
||||||
pa_xfree(c->driver);
|
pa_xfree(c->driver);
|
||||||
|
|
|
||||||
|
|
@ -170,28 +170,28 @@ static void core_free(pa_object *o) {
|
||||||
* we get here */
|
* we get here */
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->scache));
|
pa_assert(pa_idxset_isempty(c->scache));
|
||||||
pa_idxset_free(c->scache, NULL, NULL);
|
pa_idxset_free(c->scache, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->modules));
|
pa_assert(pa_idxset_isempty(c->modules));
|
||||||
pa_idxset_free(c->modules, NULL, NULL);
|
pa_idxset_free(c->modules, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->clients));
|
pa_assert(pa_idxset_isempty(c->clients));
|
||||||
pa_idxset_free(c->clients, NULL, NULL);
|
pa_idxset_free(c->clients, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->cards));
|
pa_assert(pa_idxset_isempty(c->cards));
|
||||||
pa_idxset_free(c->cards, NULL, NULL);
|
pa_idxset_free(c->cards, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->sinks));
|
pa_assert(pa_idxset_isempty(c->sinks));
|
||||||
pa_idxset_free(c->sinks, NULL, NULL);
|
pa_idxset_free(c->sinks, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->sources));
|
pa_assert(pa_idxset_isempty(c->sources));
|
||||||
pa_idxset_free(c->sources, NULL, NULL);
|
pa_idxset_free(c->sources, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->source_outputs));
|
pa_assert(pa_idxset_isempty(c->source_outputs));
|
||||||
pa_idxset_free(c->source_outputs, NULL, NULL);
|
pa_idxset_free(c->source_outputs, NULL);
|
||||||
|
|
||||||
pa_assert(pa_idxset_isempty(c->sink_inputs));
|
pa_assert(pa_idxset_isempty(c->sink_inputs));
|
||||||
pa_idxset_free(c->sink_inputs, NULL, NULL);
|
pa_idxset_free(c->sink_inputs, NULL);
|
||||||
|
|
||||||
pa_assert(pa_hashmap_isempty(c->namereg));
|
pa_assert(pa_hashmap_isempty(c->namereg));
|
||||||
pa_hashmap_free(c->namereg, NULL);
|
pa_hashmap_free(c->namereg, NULL);
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ static void remove_entry(pa_idxset *s, struct idxset_entry *e) {
|
||||||
s->n_entries--;
|
s->n_entries--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_idxset_free(pa_idxset *s, pa_free2_cb_t free_cb, void *userdata) {
|
void pa_idxset_free(pa_idxset *s, pa_free_cb_t free_cb) {
|
||||||
pa_assert(s);
|
pa_assert(s);
|
||||||
|
|
||||||
while (s->iterate_list_head) {
|
while (s->iterate_list_head) {
|
||||||
|
|
@ -148,7 +148,7 @@ void pa_idxset_free(pa_idxset *s, pa_free2_cb_t free_cb, void *userdata) {
|
||||||
remove_entry(s, s->iterate_list_head);
|
remove_entry(s, s->iterate_list_head);
|
||||||
|
|
||||||
if (free_cb)
|
if (free_cb)
|
||||||
free_cb(data, userdata);
|
free_cb(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_xfree(s);
|
pa_xfree(s);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <pulse/def.h>
|
||||||
|
|
||||||
#include <pulsecore/macro.h>
|
#include <pulsecore/macro.h>
|
||||||
|
|
||||||
/* A combination of a set and a dynamic array. Entries are indexable
|
/* A combination of a set and a dynamic array. Entries are indexable
|
||||||
|
|
@ -35,9 +37,6 @@
|
||||||
/* A special index value denoting the invalid index. */
|
/* A special index value denoting the invalid index. */
|
||||||
#define PA_IDXSET_INVALID ((uint32_t) -1)
|
#define PA_IDXSET_INVALID ((uint32_t) -1)
|
||||||
|
|
||||||
/* Similar to pa_free_cb_t, but takes a userdata argument */
|
|
||||||
typedef void (*pa_free2_cb_t)(void *p, void *userdata);
|
|
||||||
|
|
||||||
/* Generic implementations for hash and comparison functions. Just
|
/* Generic implementations for hash and comparison functions. Just
|
||||||
* compares the pointer or calculates the hash value directly from the
|
* compares the pointer or calculates the hash value directly from the
|
||||||
* pointer value. */
|
* pointer value. */
|
||||||
|
|
@ -57,7 +56,7 @@ typedef struct pa_idxset pa_idxset;
|
||||||
pa_idxset* pa_idxset_new(pa_hash_func_t hash_func, pa_compare_func_t compare_func);
|
pa_idxset* pa_idxset_new(pa_hash_func_t hash_func, pa_compare_func_t compare_func);
|
||||||
|
|
||||||
/* Free the idxset. When the idxset is not empty the specified function is called for every entry contained */
|
/* Free the idxset. When the idxset is not empty the specified function is called for every entry contained */
|
||||||
void pa_idxset_free(pa_idxset *s, pa_free2_cb_t free_cb, void *userdata);
|
void pa_idxset_free(pa_idxset *s, pa_free_cb_t free_cb);
|
||||||
|
|
||||||
/* Store a new item in the idxset. The index of the item is returned in *idx */
|
/* Store a new item in the idxset. The index of the item is returned in *idx */
|
||||||
int pa_idxset_put(pa_idxset*s, void *p, uint32_t *idx);
|
int pa_idxset_put(pa_idxset*s, void *p, uint32_t *idx);
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ void pa_cli_protocol_unref(pa_cli_protocol *p) {
|
||||||
while ((c = pa_idxset_first(p->connections, NULL)))
|
while ((c = pa_idxset_first(p->connections, NULL)))
|
||||||
cli_unlink(p, c);
|
cli_unlink(p, c);
|
||||||
|
|
||||||
pa_idxset_free(p->connections, NULL, NULL);
|
pa_idxset_free(p->connections, NULL);
|
||||||
|
|
||||||
pa_assert_se(pa_shared_remove(p->core, "cli-protocol") >= 0);
|
pa_assert_se(pa_shared_remove(p->core, "cli-protocol") >= 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ void pa_dbus_protocol_unref(pa_dbus_protocol *p) {
|
||||||
|
|
||||||
pa_hashmap_free(p->objects, NULL);
|
pa_hashmap_free(p->objects, NULL);
|
||||||
pa_hashmap_free(p->connections, NULL);
|
pa_hashmap_free(p->connections, NULL);
|
||||||
pa_idxset_free(p->extensions, NULL, NULL);
|
pa_idxset_free(p->extensions, NULL);
|
||||||
|
|
||||||
for (i = 0; i < PA_DBUS_PROTOCOL_HOOK_MAX; ++i)
|
for (i = 0; i < PA_DBUS_PROTOCOL_HOOK_MAX; ++i)
|
||||||
pa_hook_done(&p->hooks[i]);
|
pa_hook_done(&p->hooks[i]);
|
||||||
|
|
@ -928,22 +928,15 @@ static struct signal_paths_entry *signal_paths_entry_new(const char *signal_name
|
||||||
}
|
}
|
||||||
|
|
||||||
static void signal_paths_entry_free(struct signal_paths_entry *e) {
|
static void signal_paths_entry_free(struct signal_paths_entry *e) {
|
||||||
char *path = NULL;
|
|
||||||
|
|
||||||
pa_assert(e);
|
pa_assert(e);
|
||||||
|
|
||||||
pa_xfree(e->signal);
|
pa_xfree(e->signal);
|
||||||
|
pa_idxset_free(e->paths, pa_xfree);
|
||||||
while ((path = pa_idxset_steal_first(e->paths, NULL)))
|
|
||||||
pa_xfree(path);
|
|
||||||
|
|
||||||
pa_idxset_free(e->paths, NULL, NULL);
|
|
||||||
pa_xfree(e);
|
pa_xfree(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_dbus_protocol_unregister_connection(pa_dbus_protocol *p, DBusConnection *conn) {
|
int pa_dbus_protocol_unregister_connection(pa_dbus_protocol *p, DBusConnection *conn) {
|
||||||
struct connection_entry *conn_entry = NULL;
|
struct connection_entry *conn_entry = NULL;
|
||||||
char *object_path = NULL;
|
|
||||||
|
|
||||||
pa_assert(p);
|
pa_assert(p);
|
||||||
pa_assert(conn);
|
pa_assert(conn);
|
||||||
|
|
@ -954,12 +947,7 @@ int pa_dbus_protocol_unregister_connection(pa_dbus_protocol *p, DBusConnection *
|
||||||
unregister_all_objects(p, conn);
|
unregister_all_objects(p, conn);
|
||||||
|
|
||||||
dbus_connection_unref(conn_entry->connection);
|
dbus_connection_unref(conn_entry->connection);
|
||||||
|
pa_idxset_free(conn_entry->all_signals_objects, pa_xfree);
|
||||||
while ((object_path = pa_idxset_steal_first(conn_entry->all_signals_objects, NULL)))
|
|
||||||
pa_xfree(object_path);
|
|
||||||
|
|
||||||
pa_idxset_free(conn_entry->all_signals_objects, NULL, NULL);
|
|
||||||
|
|
||||||
pa_hashmap_free(conn_entry->listening_signals, (pa_free_cb_t) signal_paths_entry_free);
|
pa_hashmap_free(conn_entry->listening_signals, (pa_free_cb_t) signal_paths_entry_free);
|
||||||
pa_xfree(conn_entry);
|
pa_xfree(conn_entry);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1627,7 +1627,7 @@ void pa_esound_protocol_unref(pa_esound_protocol *p) {
|
||||||
while ((c = pa_idxset_first(p->connections, NULL)))
|
while ((c = pa_idxset_first(p->connections, NULL)))
|
||||||
connection_unlink(c);
|
connection_unlink(c);
|
||||||
|
|
||||||
pa_idxset_free(p->connections, NULL, NULL);
|
pa_idxset_free(p->connections, NULL);
|
||||||
|
|
||||||
pa_assert_se(pa_shared_remove(p->core, "esound-protocol") >= 0);
|
pa_assert_se(pa_shared_remove(p->core, "esound-protocol") >= 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -786,7 +786,7 @@ void pa_http_protocol_unref(pa_http_protocol *p) {
|
||||||
while ((c = pa_idxset_first(p->connections, NULL)))
|
while ((c = pa_idxset_first(p->connections, NULL)))
|
||||||
connection_unlink(c);
|
connection_unlink(c);
|
||||||
|
|
||||||
pa_idxset_free(p->connections, NULL, NULL);
|
pa_idxset_free(p->connections, NULL);
|
||||||
|
|
||||||
pa_strlist_free(p->servers);
|
pa_strlist_free(p->servers);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1222,7 +1222,7 @@ static playback_stream* playback_stream_new(
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (formats)
|
if (formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
@ -1340,8 +1340,8 @@ static void native_connection_free(pa_object *o) {
|
||||||
|
|
||||||
native_connection_unlink(c);
|
native_connection_unlink(c);
|
||||||
|
|
||||||
pa_idxset_free(c->record_streams, NULL, NULL);
|
pa_idxset_free(c->record_streams, NULL);
|
||||||
pa_idxset_free(c->output_streams, NULL, NULL);
|
pa_idxset_free(c->output_streams, NULL);
|
||||||
|
|
||||||
pa_pdispatch_unref(c->pdispatch);
|
pa_pdispatch_unref(c->pdispatch);
|
||||||
pa_pstream_unref(c->pstream);
|
pa_pstream_unref(c->pstream);
|
||||||
|
|
@ -2193,7 +2193,7 @@ finish:
|
||||||
if (p)
|
if (p)
|
||||||
pa_proplist_free(p);
|
pa_proplist_free(p);
|
||||||
if (formats)
|
if (formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void command_delete_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
|
static void command_delete_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
|
||||||
|
|
@ -2508,7 +2508,7 @@ finish:
|
||||||
if (p)
|
if (p)
|
||||||
pa_proplist_free(p);
|
pa_proplist_free(p);
|
||||||
if (formats)
|
if (formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void command_exit(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
|
static void command_exit(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
|
||||||
|
|
@ -3143,7 +3143,7 @@ static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sin
|
||||||
pa_tagstruct_put_format_info(t, f);
|
pa_tagstruct_put_format_info(t, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3213,7 +3213,7 @@ static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_s
|
||||||
pa_tagstruct_put_format_info(t, f);
|
pa_tagstruct_put_format_info(t, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5093,7 +5093,7 @@ void pa_native_protocol_unref(pa_native_protocol *p) {
|
||||||
while ((c = pa_idxset_first(p->connections, NULL)))
|
while ((c = pa_idxset_first(p->connections, NULL)))
|
||||||
native_connection_unlink(c);
|
native_connection_unlink(c);
|
||||||
|
|
||||||
pa_idxset_free(p->connections, NULL, NULL);
|
pa_idxset_free(p->connections, NULL);
|
||||||
|
|
||||||
pa_strlist_free(p->servers);
|
pa_strlist_free(p->servers);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -690,7 +690,7 @@ void pa_simple_protocol_unref(pa_simple_protocol *p) {
|
||||||
while ((c = pa_idxset_first(p->connections, NULL)))
|
while ((c = pa_idxset_first(p->connections, NULL)))
|
||||||
connection_unlink(c);
|
connection_unlink(c);
|
||||||
|
|
||||||
pa_idxset_free(p->connections, NULL, NULL);
|
pa_idxset_free(p->connections, NULL);
|
||||||
|
|
||||||
pa_assert_se(pa_shared_remove(p->core, "simple-protocol") >= 0);
|
pa_assert_se(pa_shared_remove(p->core, "simple-protocol") >= 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,12 +198,12 @@ pa_bool_t pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, pa_sink
|
||||||
data->sink = s;
|
data->sink = s;
|
||||||
data->save_sink = save;
|
data->save_sink = save;
|
||||||
if (data->nego_formats)
|
if (data->nego_formats)
|
||||||
pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
data->nego_formats = formats;
|
data->nego_formats = formats;
|
||||||
} else {
|
} else {
|
||||||
/* Sink doesn't support any of the formats requested by the client */
|
/* Sink doesn't support any of the formats requested by the client */
|
||||||
if (formats)
|
if (formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -216,7 +216,7 @@ pa_bool_t pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, pa_id
|
||||||
pa_assert(formats);
|
pa_assert(formats);
|
||||||
|
|
||||||
if (data->req_formats)
|
if (data->req_formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
data->req_formats = formats;
|
data->req_formats = formats;
|
||||||
|
|
||||||
|
|
@ -232,10 +232,10 @@ void pa_sink_input_new_data_done(pa_sink_input_new_data *data) {
|
||||||
pa_assert(data);
|
pa_assert(data);
|
||||||
|
|
||||||
if (data->req_formats)
|
if (data->req_formats)
|
||||||
pa_idxset_free(data->req_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(data->req_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
if (data->nego_formats)
|
if (data->nego_formats)
|
||||||
pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
if (data->format)
|
if (data->format)
|
||||||
pa_format_info_free(data->format);
|
pa_format_info_free(data->format);
|
||||||
|
|
@ -738,7 +738,7 @@ static void sink_input_free(pa_object *o) {
|
||||||
pa_proplist_free(i->proplist);
|
pa_proplist_free(i->proplist);
|
||||||
|
|
||||||
if (i->direct_outputs)
|
if (i->direct_outputs)
|
||||||
pa_idxset_free(i->direct_outputs, NULL, NULL);
|
pa_idxset_free(i->direct_outputs, NULL);
|
||||||
|
|
||||||
if (i->thread_info.direct_outputs)
|
if (i->thread_info.direct_outputs)
|
||||||
pa_hashmap_free(i->thread_info.direct_outputs, NULL);
|
pa_hashmap_free(i->thread_info.direct_outputs, NULL);
|
||||||
|
|
|
||||||
|
|
@ -730,7 +730,7 @@ static void sink_free(pa_object *o) {
|
||||||
s->monitor_source = NULL;
|
s->monitor_source = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(s->inputs, NULL, NULL);
|
pa_idxset_free(s->inputs, NULL);
|
||||||
pa_hashmap_free(s->thread_info.inputs, (pa_free_cb_t) pa_sink_input_unref);
|
pa_hashmap_free(s->thread_info.inputs, (pa_free_cb_t) pa_sink_input_unref);
|
||||||
|
|
||||||
if (s->silence.memblock)
|
if (s->silence.memblock)
|
||||||
|
|
@ -3734,7 +3734,7 @@ pa_bool_t pa_sink_check_format(pa_sink *s, pa_format_info *f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -3764,7 +3764,7 @@ pa_idxset* pa_sink_check_formats(pa_sink *s, pa_idxset *in_formats) {
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (sink_formats)
|
if (sink_formats)
|
||||||
pa_idxset_free(sink_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(sink_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
return out_formats;
|
return out_formats;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,12 +143,12 @@ pa_bool_t pa_source_output_new_data_set_source(pa_source_output_new_data *data,
|
||||||
data->source = s;
|
data->source = s;
|
||||||
data->save_source = save;
|
data->save_source = save;
|
||||||
if (data->nego_formats)
|
if (data->nego_formats)
|
||||||
pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
data->nego_formats = formats;
|
data->nego_formats = formats;
|
||||||
} else {
|
} else {
|
||||||
/* Source doesn't support any of the formats requested by the client */
|
/* Source doesn't support any of the formats requested by the client */
|
||||||
if (formats)
|
if (formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -161,7 +161,7 @@ pa_bool_t pa_source_output_new_data_set_formats(pa_source_output_new_data *data,
|
||||||
pa_assert(formats);
|
pa_assert(formats);
|
||||||
|
|
||||||
if (data->req_formats)
|
if (data->req_formats)
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
data->req_formats = formats;
|
data->req_formats = formats;
|
||||||
|
|
||||||
|
|
@ -177,10 +177,10 @@ void pa_source_output_new_data_done(pa_source_output_new_data *data) {
|
||||||
pa_assert(data);
|
pa_assert(data);
|
||||||
|
|
||||||
if (data->req_formats)
|
if (data->req_formats)
|
||||||
pa_idxset_free(data->req_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(data->req_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
if (data->nego_formats)
|
if (data->nego_formats)
|
||||||
pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
if (data->format)
|
if (data->format)
|
||||||
pa_format_info_free(data->format);
|
pa_format_info_free(data->format);
|
||||||
|
|
|
||||||
|
|
@ -659,7 +659,7 @@ static void source_free(pa_object *o) {
|
||||||
|
|
||||||
pa_log_info("Freeing source %u \"%s\"", s->index, s->name);
|
pa_log_info("Freeing source %u \"%s\"", s->index, s->name);
|
||||||
|
|
||||||
pa_idxset_free(s->outputs, NULL, NULL);
|
pa_idxset_free(s->outputs, NULL);
|
||||||
pa_hashmap_free(s->thread_info.outputs, (pa_free_cb_t) pa_source_output_unref);
|
pa_hashmap_free(s->thread_info.outputs, (pa_free_cb_t) pa_source_output_unref);
|
||||||
|
|
||||||
if (s->silence.memblock)
|
if (s->silence.memblock)
|
||||||
|
|
@ -2801,7 +2801,7 @@ pa_bool_t pa_source_check_format(pa_source *s, pa_format_info *f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -2831,7 +2831,7 @@ pa_idxset* pa_source_check_formats(pa_source *s, pa_idxset *in_formats) {
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (source_formats)
|
if (source_formats)
|
||||||
pa_idxset_free(source_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
|
pa_idxset_free(source_formats, (pa_free_cb_t) pa_format_info_free);
|
||||||
|
|
||||||
return out_formats;
|
return out_formats;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue