1
mirror of https://github.com/mpv-player/mpv synced 2024-07-31 16:29:58 +02:00

Add an option that sets initial playback volume.

patch by Reimar and rvm, rvm3000 ya com


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27872 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2008-10-31 18:44:45 +00:00
parent 5fefd9f70a
commit 74dd64e71d
4 changed files with 16 additions and 0 deletions

View File

@ -2648,6 +2648,12 @@ the maximum, which e.g.\& the OSD cannot display correctly.
Set the step size of mixer volume changes in percent of the whole range
(default: 3).
.
.TP
.B \-volume <-1\-100> (also see \-af volume)
Set the startup volume in the mixer, either hardware or software (if
used with \-softvol).
A value of -1 (the default) will not change the volume.
.
.
.
.SH "AUDIO OUTPUT DRIVERS (MPLAYER ONLY)"

View File

@ -2360,6 +2360,12 @@ debajo del m
Establece el porcentaje de incremento o decremento para los cambios de volumen,
el porcentaje es en relación con el total.
.
.TP
.B \-volume <-1\-100> (vea también \-af volume)
Establece el volumen inicial en el mezclador, ya sea por hardware o
software (si se usa con \-softvol).
Un valor de -1 (que es el valor por defecto) no cambiará el volumen.
.
.
.
.SH "CONTROLADORES DE SALIDA DE AUDIO (MPLAYER SOLAMENTE)"

View File

@ -108,6 +108,7 @@ const m_option_t mplayer_opts[]={
{"nosoftvol", &soft_vol, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"softvol-max", &soft_vol_max, CONF_TYPE_FLOAT, CONF_RANGE, 10, 10000, NULL},
{"volstep", &volstep, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
{"volume", &start_volume, CONF_TYPE_FLOAT, CONF_RANGE, -1, 10000, NULL},
{"master", "Option -master has been removed, use -af volume instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
// override audio buffer size (used only by -ao oss, anyway obsolete...)
{"abs", &ao_data.buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL},

View File

@ -86,6 +86,7 @@ int slave_mode=0;
int player_idle_mode=0;
int quiet=0;
int enable_mouse_movements=0;
float start_volume = -1;
#if defined(__MINGW32__) || defined(__CYGWIN__)
char * proc_priority=NULL;
@ -3573,6 +3574,8 @@ if(mpctx->sh_video){
audio_delay += mpctx->sh_video->stream_delay;
}
if(mpctx->sh_audio){
if (start_volume >= 0)
mixer_setvolume(&mpctx->mixer, start_volume, start_volume);
if (! ignore_start)
audio_delay -= mpctx->sh_audio->stream_delay;
mpctx->delay=-audio_delay;