alsa: move pa_alsa_setting_select close to pa_alsa_path_select
authorJarkko Nikula <jarkko.nikula@bitmer.com>
Thu, 22 Mar 2012 09:29:11 +0000 (11:29 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 6 Jul 2012 17:38:10 +0000 (20:38 +0300)
Move pa_alsa_setting_select call just after the pa_alsa_path_select in
[sink | source]_set_port_cb functions as there is no dependency to volume
calculations that are done between these two calls. Idea here is to make
possible to merge these two functions since they are called together from
other places too.

src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c

index a7e543e..5fe397c 100644 (file)
@@ -1463,11 +1463,11 @@ static int sink_set_port_cb(pa_sink *s, pa_device_port *p) {
     pa_assert_se(u->mixer_path = data->path);
     pa_alsa_path_select(u->mixer_path, u->mixer_handle, s->muted);
 
-    mixer_volume_init(u);
-
     if (data->setting)
         pa_alsa_setting_select(data->setting, u->mixer_handle);
 
+    mixer_volume_init(u);
+
     if (s->set_mute)
         s->set_mute(s);
     if (s->flags & PA_SINK_DEFERRED_VOLUME) {
index 616215e..2342f40 100644 (file)
@@ -1366,11 +1366,11 @@ static int source_set_port_cb(pa_source *s, pa_device_port *p) {
     pa_assert_se(u->mixer_path = data->path);
     pa_alsa_path_select(u->mixer_path, u->mixer_handle, s->muted);
 
-    mixer_volume_init(u);
-
     if (data->setting)
         pa_alsa_setting_select(data->setting, u->mixer_handle);
 
+    mixer_volume_init(u);
+
     if (s->set_mute)
         s->set_mute(s);
     if (s->flags & PA_SOURCE_DEFERRED_VOLUME) {