aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-26 19:43:18 +0100
committerMax Kellermann <max@duempel.org>2009-03-26 19:43:18 +0100
commit617a4fd2d2eff45393c4e243129a4648822d5d86 (patch)
tree0b11f58f1dd145a273378e31a5ba8506251abe97 /src/mixer
parent7475ded935a00d790d4e97ecf55f4fb3306d80fb (diff)
downloadmpd-617a4fd2d2eff45393c4e243129a4648822d5d86.tar.gz
mpd-617a4fd2d2eff45393c4e243129a4648822d5d86.tar.xz
mpd-617a4fd2d2eff45393c4e243129a4648822d5d86.zip
mixer: added flag "open"
Remember if a mixer object is open or closed. Don't call open() again if it is already open. This guarantees that the mixer plugin is always called in a consistent state, and we will be able to remove lots of checks from the implementations. To support mixers which are automatically opened even if the audio output is still closed (to set the volume before playback starts), this patch also adds the "global" flag to the mixer_plugin struct. Both ALSA and OSS set this flag, while PULSE does not.
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/alsa_mixer.c1
-rw-r--r--src/mixer/oss_mixer.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c
index ea113b861..c5aac13d4 100644
--- a/src/mixer/alsa_mixer.c
+++ b/src/mixer/alsa_mixer.c
@@ -230,4 +230,5 @@ const struct mixer_plugin alsa_mixer = {
.close = alsa_mixer_close,
.get_volume = alsa_mixer_get_volume,
.set_volume = alsa_mixer_set_volume,
+ .global = true,
};
diff --git a/src/mixer/oss_mixer.c b/src/mixer/oss_mixer.c
index 8789ac00c..13e325823 100644
--- a/src/mixer/oss_mixer.c
+++ b/src/mixer/oss_mixer.c
@@ -198,4 +198,5 @@ const struct mixer_plugin oss_mixer = {
.close = oss_mixer_close,
.get_volume = oss_mixer_get_volume,
.set_volume = oss_mixer_set_volume,
+ .global = true,
};