summaryrefslogtreecommitdiffstats
path: root/module-4a-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'module-4a-client.c')
-rw-r--r--module-4a-client.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/module-4a-client.c b/module-4a-client.c
index eabeec7..83888c7 100644
--- a/module-4a-client.c
+++ b/module-4a-client.c
@@ -119,7 +119,7 @@ static pa_sink *load_sink_module(pa_core *core, const char *module, char *params
pa_sink *target = NULL;
uint32_t idx;
- if (pa_module_load(&m, core, module, params) < 0) {
+ if (!(m = pa_module_load(core, module, params))) {
pa_log("Failed to load module %s %s", module, params);
return NULL;
}
@@ -312,6 +312,31 @@ static pa_hook_result_t sink_input_unlink_post_cb(pa_core *core,
return PA_HOOK_OK;
}
+void pa__done(pa_module *self) {
+ m4a_data *d;
+
+ pa_assert(self);
+
+ d = self->userdata;
+
+ while (d->streams)
+ m4a_stream_free(d->streams);
+
+ pa_dynarray_free(d->roles);
+ pa_mutex_free(d->lock);
+
+ if (d->ma)
+ pa_modargs_free(d->ma);
+
+ if (d->sink_input_put_slot)
+ pa_hook_slot_free(d->sink_input_put_slot);
+ if (d->sink_input_unlink_post_slot)
+ pa_hook_slot_free(d->sink_input_unlink_post_slot);
+
+ if (d->comm)
+ m4a_afb_comm_free(d->comm);
+}
+
int pa__init(pa_module *self) {
m4a_data *d;
const char *uri;
@@ -347,28 +372,3 @@ fail:
pa__done(self);
return -1;
}
-
-void pa__done(pa_module *self) {
- m4a_data *d;
-
- pa_assert(self);
-
- d = self->userdata;
-
- while (d->streams)
- m4a_stream_free(d->streams);
-
- pa_dynarray_free(d->roles);
- pa_mutex_free(d->lock);
-
- if (d->ma)
- pa_modargs_free(d->ma);
-
- if (d->sink_input_put_slot)
- pa_hook_slot_free(d->sink_input_put_slot);
- if (d->sink_input_unlink_post_slot)
- pa_hook_slot_free(d->sink_input_unlink_post_slot);
-
- if (d->comm)
- m4a_afb_comm_free(d->comm);
-}