echo-cancel: Fail if loaded between a sink and its monitor
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 4 Oct 2011 08:36:26 +0000 (14:06 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 4 Oct 2011 08:38:01 +0000 (14:08 +0530)
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.

src/modules/echo-cancel/module-echo-cancel.c

index 7e0dcef..c2db87e 100644 (file)
@@ -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;