summaryrefslogtreecommitdiff
path: root/src/modules/alsa/alsa-mixer.c
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@bitmer.com>2012-03-22 11:29:12 +0200
committerTanu Kaskinen <tanuk@iki.fi>2012-07-06 20:38:10 +0300
commit079569753e245393c3ce9ea8923a60fcd9799d34 (patch)
treea7bc5279892a63e2ff008e81f42036511d15b584 /src/modules/alsa/alsa-mixer.c
parentfbb13a0dc6aca2c2e3bb746c267c717a11d6f2f0 (diff)
alsa: Merge pa_alsa_setting_select with pa_alsa_path_select
As these functions are called together and are related, we might merge them and call setting_select from pa_alsa_path_select by passing optional pa_alsa_setting argument. Make also the setting_select static as it is not called outside of alsa-mixer.c after this change. [Additional note from Tanu Kaskinen: this change improves the mute-during-activation feature, because now the mixer changes related to selecting the setting happen while the hw is muted.]
Diffstat (limited to 'src/modules/alsa/alsa-mixer.c')
-rw-r--r--src/modules/alsa/alsa-mixer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 842363602..b46508c40 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -50,6 +50,8 @@
#include "alsa-mixer.h"
#include "alsa-util.h"
+static int setting_select(pa_alsa_setting *s, snd_mixer_t *m);
+
struct description_map {
const char *name;
const char *description;
@@ -1196,7 +1198,7 @@ static int element_set_constant_volume(pa_alsa_element *e, snd_mixer_t *m) {
return r;
}
-int pa_alsa_path_select(pa_alsa_path *p, snd_mixer_t *m, bool device_is_muted) {
+int pa_alsa_path_select(pa_alsa_path *p, pa_alsa_setting *s, snd_mixer_t *m, bool device_is_muted) {
pa_alsa_element *e;
int r = 0;
@@ -1257,6 +1259,9 @@ int pa_alsa_path_select(pa_alsa_path *p, snd_mixer_t *m, bool device_is_muted) {
return -1;
}
+ if (s)
+ setting_select(s, m);
+
/* Finally restore hw mute to the device mute status. */
if (p->mute_during_activation) {
PA_LLIST_FOREACH(e, p->elements) {
@@ -2228,7 +2233,7 @@ static int element_set_option(pa_alsa_element *e, snd_mixer_t *m, int alsa_idx)
return r;
}
-int pa_alsa_setting_select(pa_alsa_setting *s, snd_mixer_t *m) {
+static int setting_select(pa_alsa_setting *s, snd_mixer_t *m) {
pa_alsa_option *o;
uint32_t idx;