summaryrefslogtreecommitdiffstats
path: root/mixer.h
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-06 16:23:43 +0100
committerwm4 <wm4@mplayer2.org>2012-01-18 04:21:45 +0100
commit29effe9593465f9096227edb79e09e51ca8a054d (patch)
tree5d451166dcaef5cd3c7d707195ca818e5f47f54b /mixer.h
parent95c52f865da2459f47ed708c41324f0cc5386da3 (diff)
downloadmpv-29effe9593465f9096227edb79e09e51ca8a054d.tar.bz2
mpv-29effe9593465f9096227edb79e09e51ca8a054d.tar.xz
mixer: restore volume with audio output drivers without persistent volume
Some audio outputs don't provide access to a system-wide mixer control, and do per-application audio mixing. Further, some of these forget the volume as soon as the audio device is closed. This can be annoying, because mplayer will "forget" the volume when playing a new file or when crossing ordered chapter boundaries. Support restoring the volume on audio reinitialization if an audio output driver knowingly behaves this way. (This doesn't change that mplayer never writes any settings into the config file, including volume settings.) This commit doesn't yet change any actual output driver to use this code. Hopefully make some logic in the volume restore code a bit more robust.
Diffstat (limited to 'mixer.h')
-rw-r--r--mixer.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/mixer.h b/mixer.h
index 1e45ac56b4..5aa60d67d1 100644
--- a/mixer.h
+++ b/mixer.h
@@ -19,6 +19,8 @@
#ifndef MPLAYER_MIXER_H
#define MPLAYER_MIXER_H
+#include <stdbool.h>
+
#include "libaf/af.h"
#include "libao2/audio_out.h"
@@ -33,9 +35,10 @@ typedef struct mixer_s {
int volstep;
int muted;
float last_l, last_r;
- float softvol_l, softvol_r;
- int restore_softvol;
+ float restore_vol_l, restore_vol_r;
+ bool restore_volume;
float balance;
+ bool restore_balance;
} mixer_t;
void mixer_reinit(mixer_t *mixer);