changeset 27838:13738bdebf9a

Add an option that sets initial playback volume. patch by Reimar and rvm, rvm3000 ya com
author diego
date Fri, 31 Oct 2008 18:44:45 +0000
parents 2a36db2f583d
children 9a46fffef0fc
files DOCS/man/en/mplayer.1 DOCS/man/es/mplayer.1 cfg-mplayer.h mplayer.c
diffstat 4 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Fri Oct 31 13:13:52 2008 +0000
+++ b/DOCS/man/en/mplayer.1	Fri Oct 31 18:44:45 2008 +0000
@@ -2648,6 +2648,12 @@
 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)"
--- a/DOCS/man/es/mplayer.1	Fri Oct 31 13:13:52 2008 +0000
+++ b/DOCS/man/es/mplayer.1	Fri Oct 31 18:44:45 2008 +0000
@@ -2360,6 +2360,12 @@
 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)"
--- a/cfg-mplayer.h	Fri Oct 31 13:13:52 2008 +0000
+++ b/cfg-mplayer.h	Fri Oct 31 18:44:45 2008 +0000
@@ -108,6 +108,7 @@
         {"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},
--- a/mplayer.c	Fri Oct 31 13:13:52 2008 +0000
+++ b/mplayer.c	Fri Oct 31 18:44:45 2008 +0000
@@ -86,6 +86,7 @@
 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 @@
     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;