summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/cfg-mplayer.h6
-rw-r--r--core/defaultopts.c2
-rw-r--r--core/mplayer.c8
-rw-r--r--core/options.h2
4 files changed, 14 insertions, 4 deletions
diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h
index 26649b42f6..c45d4b42c7 100644
--- a/core/cfg-mplayer.h
+++ b/core/cfg-mplayer.h
@@ -570,7 +570,11 @@ const m_option_t mplayer_opts[]={
{"auto", SOFTVOL_AUTO})),
OPT_FLOATRANGE("softvol-max", softvol_max, 0, 10, 10000),
{"volstep", &volstep, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
- {"volume", &start_volume, CONF_TYPE_FLOAT, CONF_RANGE, -1, 10000, NULL},
+ OPT_FLOATRANGE("volume", mixer_init_volume, 0, -1, 10000),
+ OPT_CHOICE("mute", mixer_init_mute, 0,
+ ({"auto", -1},
+ {"no", 0},
+ {"yes", 1})),
OPT_MAKE_FLAGS("gapless-audio", gapless_audio, 0),
// override audio buffer size (used only by -ao oss/win32, obsolete)
OPT_INT("abs", ao_buffersize, 0),
diff --git a/core/defaultopts.c b/core/defaultopts.c
index a20656dd02..28ae445388 100644
--- a/core/defaultopts.c
+++ b/core/defaultopts.c
@@ -13,6 +13,8 @@ void set_default_mplayer_options(struct MPOpts *opts)
.fixed_vo = 1,
.softvol = SOFTVOL_AUTO,
.softvol_max = 200,
+ .mixer_init_volume = -1,
+ .mixer_init_mute = -1,
.ao_buffersize = -1,
.vo_wintitle = "mpv - ${media-title}",
.monitor_pixel_aspect = 1.0,
diff --git a/core/mplayer.c b/core/mplayer.c
index 3d38330c0a..d632bf5615 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -103,7 +103,6 @@
int slave_mode = 0;
int enable_mouse_movements = 0;
-float start_volume = -1;
#include "osdep/priority.h"
@@ -3947,8 +3946,11 @@ goto_enable_cache:
audio_delay += mpctx->sh_video->stream_delay;
}
if (mpctx->sh_audio) {
- if (start_volume >= 0)
- mixer_setvolume(&mpctx->mixer, start_volume, start_volume);
+ if (opts->mixer_init_volume >= 0)
+ mixer_setvolume(&mpctx->mixer, opts->mixer_init_volume,
+ opts->mixer_init_volume);
+ if (opts->mixer_init_mute >= 0)
+ mixer_setmute(&mpctx->mixer, opts->mixer_init_mute);
if (!ignore_start)
audio_delay -= mpctx->sh_audio->stream_delay;
}
diff --git a/core/options.h b/core/options.h
index 03298554cd..0ceef0f25a 100644
--- a/core/options.h
+++ b/core/options.h
@@ -11,6 +11,8 @@ typedef struct MPOpts {
char *mixer_device;
char *mixer_channel;
int softvol;
+ float mixer_init_volume;
+ int mixer_init_mute;
float softvol_max;
int gapless_audio;
int ao_buffersize;