summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-10-04 14:06:26 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-10-04 14:08:01 +0530
commite681469154116cfef2411385ae00d9fb91b46bfc (patch)
tree343b6616557fd2e394497862ce504fb087706889
parentd086f15c91e1919127b4ba62841de77235e003dd (diff)
echo-cancel: Fail if loaded between a sink and its monitor
Loading between a sink and its monitor causes a deadlock (while sending messages for latency snapshots). It isn't a case that has any real conceivable use, so let's just disallow it.
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 7e0dcefca..c2db87efc 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1357,6 +1357,11 @@ int pa__init(pa_module*m) {
}
pa_assert(sink_master);
+ if (source_master->monitor_of == sink_master) {
+ pa_log("Can't cancel echo between a sink and its monitor");
+ goto fail;
+ }
+
source_ss = source_master->sample_spec;
source_ss.rate = DEFAULT_RATE;
source_ss.channels = DEFAULT_CHANNELS;