diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-04-20 17:45:26 +0530 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2011-04-23 18:23:38 +0100 |
commit | 42b378b13028751cbdd607cb6b7c840b9fb28876 (patch) | |
tree | bbf207a0f196b31de70d94cf3d31c9e4b0398827 /src/modules | |
parent | b620e322894a3dbf5c59ffb55df4e221d169c510 (diff) |
filter-heuristics: Only apply AEC if we're not already on a phone sink
This makes sure that we don't apply AEC on sinks that are already
connected to a "phone" device, the assumptiong being that anything
marked as such either doesn't have need it, or handles it itself.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/module-filter-heuristics.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/module-filter-heuristics.c b/src/modules/module-filter-heuristics.c index bd8a6003..a385ff24 100644 --- a/src/modules/module-filter-heuristics.c +++ b/src/modules/module-filter-heuristics.c @@ -50,7 +50,7 @@ struct userdata { }; static pa_hook_result_t sink_input_put_cb(pa_core *core, pa_sink_input *i, struct userdata *u) { - const char *role; + const char *sink_role, *si_role; pa_core_assert_ref(core); pa_sink_input_assert_ref(i); @@ -60,7 +60,10 @@ static pa_hook_result_t sink_input_put_cb(pa_core *core, pa_sink_input *i, struc if (pa_proplist_gets(i->proplist, PA_PROP_FILTER_WANT)) return PA_HOOK_OK; - if ((role = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_ROLE)) && pa_streq(role, "phone")) + if ((sink_role = pa_proplist_gets(i->sink->proplist, PA_PROP_DEVICE_INTENDED_ROLES)) && strstr(sink_role, "phone")) + return PA_HOOK_OK; + + if ((si_role = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_ROLE)) && pa_streq(si_role, "phone")) pa_proplist_sets(i->proplist, PA_PROP_FILTER_WANT, "echo-cancel"); return PA_HOOK_OK; |