summaryrefslogtreecommitdiffstats
path: root/module-4a-client.c
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2018-08-02 19:25:16 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2018-08-28 12:14:13 +0300
commit9cd72ed153f6615ed826b048e1c344bf4640bd2b (patch)
tree383ba3b419f2d81853f44167f4d78a641255c03d /module-4a-client.c
parent7841a51ba055a59160b6b7f6d360f580027bfddd (diff)
the stream was being free'ed twice because the async device_close_cb would also free it Change-Id: I9d396b92d4c8c967f4f83a54c85600e901c81cbc Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Diffstat (limited to 'module-4a-client.c')
-rw-r--r--module-4a-client.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/module-4a-client.c b/module-4a-client.c
index 3e519ca..41885ae 100644
--- a/module-4a-client.c
+++ b/module-4a-client.c
@@ -266,8 +266,7 @@ static pa_hook_result_t sink_input_put_cb(pa_core *core,
pa_log_info("moving sink_input to alsa sink");
pa_sink_input_move_to(i, s, false);
} else {
- pa_xfree(stream->device_uri);
- stream->device_uri = NULL;
+ pa_log_info("failed to load alsa sink, closing 4A device");
jparams = json_object_new_object();
json_object_object_add(jparams, "action",
@@ -275,10 +274,9 @@ static pa_hook_result_t sink_input_put_cb(pa_core *core,
m4a_afb_call_async(d->comm, role, jparams,
(m4a_afb_done_cb_t) device_close_cb, stream);
+ return PA_HOOK_CANCEL;
}
- }
-
- if (!stream->device_uri) {
+ } else {
pa_log_info("sink_input is not authorized to connect to 4A");
//TODO maybe queue and play this stream when 4A allows it