aboutsummaryrefslogtreecommitdiff
path: root/src/output_control.c
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/output_control.c
parent7475ded935a00d790d4e97ecf55f4fb3306d80fb (diff)
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/output_control.c')
-rw-r--r--src/output_control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/output_control.c b/src/output_control.c
index d19ce358..4131594f 100644
--- a/src/output_control.c
+++ b/src/output_control.c
@@ -22,6 +22,7 @@
#include "output_internal.h"
#include "output_thread.h"
#include "mixer_control.h"
+#include "mixer_plugin.h"
#include <assert.h>
#include <stdlib.h>
@@ -149,7 +150,7 @@ void audio_output_close(struct audio_output *ao)
assert(!ao->open || ao->fail_timer == NULL);
if (ao->mixer != NULL)
- mixer_close(ao->mixer);
+ mixer_auto_close(ao->mixer);
if (ao->open)
ao_command(ao, AO_COMMAND_CLOSE);