filters: Fix the master source/sink when autoloaded
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 23 Nov 2011 11:16:12 +0000 (16:46 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 24 Nov 2011 07:05:48 +0000 (12:35 +0530)
When autoloaded, it is expected that module-filter-apply (or whatever is
loading us) will take care of applying the filter on the correct
sink/source master. Instead of adding complexity by tracking what is
currently being filtered, we just disallow filtering anything except the
original master sink/source and let module-filter-apply or whatever is
loading us deal with dynamic sink/source changes.

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

index b810a4e..64e17bf 100644 (file)
@@ -1399,7 +1399,7 @@ static pa_bool_t source_output_may_move_to_cb(pa_source_output *o, pa_source *de
     pa_assert_ctl_context();
     pa_assert_se(u = o->userdata);
 
-    if (u->dead)
+    if (u->dead || u->autoloaded)
         return FALSE;
 
     return (u->source != dest) && (u->sink != dest->monitor_of);
@@ -1412,7 +1412,7 @@ static pa_bool_t sink_input_may_move_to_cb(pa_sink_input *i, pa_sink *dest) {
     pa_sink_input_assert_ref(i);
     pa_assert_se(u = i->userdata);
 
-    if (u->dead)
+    if (u->dead || u->autoloaded)
         return FALSE;
 
     return u->sink != dest;
index e83a41d..006b3d1 100644 (file)
@@ -1055,6 +1055,9 @@ static pa_bool_t sink_input_may_move_to_cb(pa_sink_input *i, pa_sink *dest) {
     pa_sink_input_assert_ref(i);
     pa_assert_se(u = i->userdata);
 
+    if (u->autoloaded)
+        return FALSE;
+
     return u->sink != dest;
 }