[vlc-devel] Regarding bug #3913 (cli volume option)
Francois Cartegnie
fcvlcdev at free.fr
Sat Mar 19 16:34:06 CET 2011
Hi,
The audio command line --volume is broken.
vlc --intf=dummy --volume=0 foobar.mp3
- The command line option is correcly parsed
- The aout output instance has been set to vlcrc value
- No call aoutSetVolume() is made from cli/dummy
Seems there's a prefs/command line var priority problem when the aout_ouput
retrieves its value.
Here follows a test late fix that enlightens the problem:
- var_inherit(volume) gets command line or defaults to vlcrc.
- forcing the value again fixes the volume problem.
Anyone knows where to look to (correctly) fix the problem earlier ?
Francois
From fcdd85692c428c6bfb76c0c6c89970ae26e56807 Mon Sep 17 00:00:00 2001
From: Francois Cartegnie <fcvlcdev at free.fr>
Date: Sat, 19 Mar 2011 16:08:57 +0100
Subject: [PATCH] testing #3913 fix
---
src/audio_output/output.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index ee37b38..cb0be9c 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -45,6 +45,7 @@ int aout_OutputNew( aout_instance_t * p_aout,
{
/* Retrieve user defaults. */
int i_rate = var_InheritInteger( p_aout, "aout-rate" );
+ int i_volume = var_InheritInteger( p_aout, "volume" );
vlc_value_t val, text;
/* kludge to avoid a fpu error when rate is 0... */
if( i_rate == 0 ) i_rate = -1;
@@ -182,6 +183,9 @@ int aout_OutputNew( aout_instance_t * p_aout,
p_aout->mixer_format.i_format = p_format->i_format;
}
+ /* set initial volume */
+ p_aout->output.pf_volume_set( p_aout, i_volume );
+
aout_FormatPrint( p_aout, "mixer", &p_aout->mixer_format );
/* Create filters. */
--
1.7.3.4
More information about the vlc-devel
mailing list