[pulseaudio-discuss] [PATCH 4/4] alsa: Don't move streams when changing profiles

Tanu Kaskinen tanuk at iki.fi
Thu Mar 14 13:07:15 PDT 2013


The job of the alsa modules is to provide hardware access, not to
implement any policy. Moving a stream is always a policy action, so
the alsa modules should not do that.
---
 src/modules/alsa/module-alsa-card.c |   19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index 3b96cea..0e823a5 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -203,7 +203,6 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
     struct profile_data *nd, *od;
     uint32_t idx;
     pa_alsa_mapping *am;
-    pa_queue *sink_inputs = NULL, *source_outputs = NULL;
 
     pa_assert(c);
     pa_assert(new_profile);
@@ -222,7 +221,6 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
                 pa_idxset_get_by_data(nd->profile->output_mappings, am, NULL))
                 continue;
 
-            sink_inputs = pa_sink_move_all_start(am->sink, sink_inputs);
             pa_alsa_sink_free(am->sink);
             am->sink = NULL;
         }
@@ -237,7 +235,6 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
                 pa_idxset_get_by_data(nd->profile->input_mappings, am, NULL))
                 continue;
 
-            source_outputs = pa_source_move_all_start(am->source, source_outputs);
             pa_alsa_source_free(am->source);
             am->source = NULL;
         }
@@ -254,11 +251,6 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
 
             if (!am->sink)
                 am->sink = pa_alsa_sink_new(c->module, u->modargs, __FILE__, c, am);
-
-            if (sink_inputs && am->sink) {
-                pa_sink_move_all_finish(am->sink, sink_inputs, FALSE);
-                sink_inputs = NULL;
-            }
         }
 
     if (nd->profile && nd->profile->input_mappings)
@@ -266,19 +258,8 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
 
             if (!am->source)
                 am->source = pa_alsa_source_new(c->module, u->modargs, __FILE__, c, am);
-
-            if (source_outputs && am->source) {
-                pa_source_move_all_finish(am->source, source_outputs, FALSE);
-                source_outputs = NULL;
-            }
         }
 
-    if (sink_inputs)
-        pa_sink_move_all_fail(sink_inputs);
-
-    if (source_outputs)
-        pa_source_move_all_fail(source_outputs);
-
     return 0;
 }
 
-- 
1.7.10.4



More information about the pulseaudio-discuss mailing list