summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2019-06-28 17:28:52 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2019-06-28 17:28:52 +0300
commit6b65b2855929190135e8498f5511e9cf8e7a0c26 (patch)
tree47e2f4b748fdcecc218c781a05c3623404a21145 /binding
parent224712ad5f07dccb6acb19ddf8333d822c7928ce (diff)
audiomixer: fix a couple of stupid mistakes
This makes the code actually work now Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Change-Id: I8dad07fc463ca00d4f16be63f0ad73946f6da0bc
Diffstat (limited to 'binding')
-rw-r--r--binding/audiomixer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/binding/audiomixer.c b/binding/audiomixer.c
index c4ccc12..85ecfc0 100644
--- a/binding/audiomixer.c
+++ b/binding/audiomixer.c
@@ -26,7 +26,6 @@ struct audiomixer
struct spa_hook remote_listener;
struct pw_core_proxy *core_proxy;
- struct spa_hook remote_core_listener;
struct pw_registry_proxy *registry_proxy;
struct spa_hook registry_listener;
@@ -233,11 +232,11 @@ endpoint_param (void *object, int seq, uint32_t id,
return;
}
- if (strcmp (name, "volume")) {
+ if (!strcmp (name, "volume")) {
spa_pod_get_int(&prop->value, &ctl->volume_control_id);
prop = spa_pod_object_find_prop(obj, NULL,
PW_ENDPOINT_PARAM_CONTROL_type);
- } else if (strcmp (name, "mute")) {
+ } else if (!strcmp (name, "mute")) {
spa_pod_get_int(&prop->value, &ctl->mute_control_id);
}
@@ -247,7 +246,7 @@ endpoint_param (void *object, int seq, uint32_t id,
uint32_t tmp_id = -1;
/* verify conditions */
- if (endpoint->state != EP_STATE_COLLECT_CONTROL ||
+ if (endpoint->state != EP_STATE_COLLECT_CONTROL &&
endpoint->state != EP_STATE_ACTIVE) {
debug("endpoint_param Control: wrong state");
return;
@@ -441,6 +440,9 @@ audiomixer_new(void)
pw_array_init(&self->endpoints, 1 * sizeof(void*));
pw_array_init(&self->all_mixer_controls, 8 * sizeof(void*));
+ pw_remote_add_listener(self->remote, &self->remote_listener,
+ &remote_events, self);
+
pw_module_load(self->core, "libpipewire-module-endpoint", NULL, NULL,
NULL, NULL);
pw_thread_loop_start(self->main_loop);