[MPlayer-cvslog] r27872 - in trunk: DOCS/man/en/mplayer.1 DOCS/man/es/mplayer.1 cfg-mplayer.h mplayer.c
diego
subversion at mplayerhq.hu
Fri Oct 31 19:44:45 CET 2008
Author: diego
Date: Fri Oct 31 19:44:45 2008
New Revision: 27872
Log:
Add an option that sets initial playback volume.
patch by Reimar and rvm, rvm3000 ya com
Modified:
trunk/cfg-mplayer.h
trunk/mplayer.c
Changes in other areas also in this revision:
Modified:
trunk/DOCS/man/en/mplayer.1
trunk/DOCS/man/es/mplayer.1
Modified: trunk/cfg-mplayer.h
==============================================================================
--- trunk/cfg-mplayer.h (original)
+++ trunk/cfg-mplayer.h Fri Oct 31 19:44:45 2008
@@ -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},
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c (original)
+++ trunk/mplayer.c Fri Oct 31 19:44:45 2008
@@ -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;
More information about the MPlayer-cvslog
mailing list