From 4331733c19fb2355008a5e754f93462b7e38e518 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 25 Apr 2016 18:14:04 +0530 Subject: module-filter-apply: Don't implement policy in module-device-manager This adds an ignore mechanism to module-device-manager and uses that from within module-filter-apply, rather than having m-d-m have knowledge of anything related to m-f-a. Signed-off-by: Arun Raghavan --- src/modules/module-device-manager.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/modules/module-device-manager.c') diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c index 0df9575b9..b3115ee81 100644 --- a/src/modules/module-device-manager.c +++ b/src/modules/module-device-manager.c @@ -649,7 +649,7 @@ static void update_highest_priority_device_indexes(struct userdata *u, const cha } static void route_sink_input(struct userdata *u, pa_sink_input *si) { - const char *filter_device; + const char *ignore; const char *role; uint32_t role_index, device_index; pa_sink *sink; @@ -664,13 +664,8 @@ static void route_sink_input(struct userdata *u, pa_sink_input *si) { if (!si->sink) return; - /* If module-filter-apply has loaded a filter for the stream, let's not - * break the filtering. The pa_streq() check is needed, because - * module-filter-apply doesn't unset the property when the stream moves - * away from the filter device for whatever reason (this is ugly, but - * easier to do this way than appropriately unsetting the property). */ - filter_device = pa_proplist_gets(si->proplist, "module-filter-apply.filter_device"); - if (filter_device && pa_streq(filter_device, si->sink->name)) + ignore = pa_proplist_gets(si->proplist, "module-device-manager.ignore"); + if (ignore && (pa_parse_boolean(ignore) == 1)) return; /* It might happen that a stream and a sink are set up at the @@ -717,7 +712,7 @@ static pa_hook_result_t route_sink_inputs(struct userdata *u, pa_sink *ignore_si } static void route_source_output(struct userdata *u, pa_source_output *so) { - const char *filter_device; + const char *ignore; const char *role; uint32_t role_index, device_index; pa_source *source; @@ -735,13 +730,8 @@ static void route_source_output(struct userdata *u, pa_source_output *so) { if (!so->source) return; - /* If module-filter-apply has loaded a filter for the stream, let's not - * break the filtering. The pa_streq() check is needed, because - * module-filter-apply doesn't unset the property when the stream moves - * away from the filter device for whatever reason (this is ugly, but - * easier to do this way than appropriately unsetting the property). */ - filter_device = pa_proplist_gets(so->proplist, "module-filter-apply.filter_device"); - if (filter_device && pa_streq(filter_device, so->source->name)) + ignore = pa_proplist_gets(so->proplist, "module-device-manager.ignore"); + if (ignore && (pa_parse_boolean(ignore) == 1)) return; /* It might happen that a stream and a source are set up at the -- cgit v1.2.1