summaryrefslogtreecommitdiffstats
path: root/src/modules/module-match.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/module-match.c')
-rw-r--r--src/modules/module-match.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/module-match.c b/src/modules/module-match.c
index 625f2a8b..b1693f18 100644
--- a/src/modules/module-match.c
+++ b/src/modules/module-match.c
@@ -85,7 +85,7 @@ static int load_rules(struct userdata *u, const char *filename) {
pa_assert(u);
if (filename)
- f = fopen(fn = pa_xstrdup(filename), "r");
+ f = pa_fopen_cloexec(fn = pa_xstrdup(filename), "r");
else
f = pa_open_config_file(DEFAULT_MATCH_TABLE_FILE, DEFAULT_MATCH_TABLE_FILE_USER, NULL, &fn);
@@ -216,7 +216,7 @@ static void callback(pa_core *c, pa_subscription_event_type_t t, uint32_t idx, v
pa_cvolume cv;
pa_log_debug("changing volume of sink input '%s' to 0x%03x", n, r->volume);
pa_cvolume_set(&cv, si->sample_spec.channels, r->volume);
- pa_sink_input_set_volume(si, &cv, TRUE, TRUE);
+ pa_sink_input_set_volume(si, &cv, TRUE, FALSE);
}
}
}
@@ -243,6 +243,9 @@ int pa__init(pa_module*m) {
if (load_rules(u, pa_modargs_get_value(ma, "table", NULL)) < 0)
goto fail;
+ /* FIXME: Doing this asynchronously is just broken. This needs to
+ * use a hook! */
+
u->subscription = pa_subscription_new(m->core, PA_SUBSCRIPTION_MASK_SINK_INPUT, callback, u);
pa_modargs_free(ma);