From 617a4fd2d2eff45393c4e243129a4648822d5d86 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Mar 2009 19:43:18 +0100 Subject: 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. --- src/mixer_api.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mixer_api.c') diff --git a/src/mixer_api.c b/src/mixer_api.c index aaa250d33..50bf8c1b1 100644 --- a/src/mixer_api.c +++ b/src/mixer_api.c @@ -27,4 +27,5 @@ mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin) { mixer->plugin = plugin; mixer->mutex = g_mutex_new(); + mixer->open = false; } -- cgit v1.2.3