[vlc-commits] equalizer: load the equalizer-preset only if equalizer-bands is not set
Adrien Maglo
git at videolan.org
Fri Jun 20 17:11:56 CEST 2014
vlc/vlc-2.2 | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Jun 18 16:27:49 2014 +0200| [ac2c33bf9b77f15e157bf13c6578872a93b288ec] | committer: Jean-Baptiste Kempf
equalizer: load the equalizer-preset only if equalizer-bands is not set
When using the libVLC equalizer API, this prevents the band settings to be overridden on start by the default "flat" preset.
(cherry picked from commit 083b686c61404dd071327dea6a1766ab6f6c69eb)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=ac2c33bf9b77f15e157bf13c6578872a93b288ec
---
modules/audio_filter/equalizer.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/audio_filter/equalizer.c b/modules/audio_filter/equalizer.c
index a7ce684..f8ca033 100644
--- a/modules/audio_filter/equalizer.c
+++ b/modules/audio_filter/equalizer.c
@@ -341,11 +341,13 @@ static int EqzInit( filter_t *p_filter, int i_rate )
/* Get initial values */
var_Get( p_aout, "equalizer-preset", &val1 );
- PresetCallback( VLC_OBJECT( p_aout ), NULL, val1, val1, p_sys );
- free( val1.psz_string );
-
var_Get( p_aout, "equalizer-bands", &val2 );
var_Get( p_aout, "equalizer-preamp", &val3 );
+
+ /* Load the preset only if equalizer-bands is not set. */
+ if (val2.psz_string != NULL && *val2.psz_string != "\0")
+ PresetCallback( VLC_OBJECT( p_aout ), NULL, val1, val1, p_sys );
+ free( val1.psz_string );
BandsCallback( VLC_OBJECT( p_aout ), NULL, val2, val2, p_sys );
PreampCallback( VLC_OBJECT( p_aout ), NULL, val3, val3, p_sys );
More information about the vlc-commits
mailing list