[vlc-devel] [PATCH] equalizer: increase precision of frequency centers in debug output

Ronald Wright logiconcepts819 at gmail.com
Thu Mar 21 00:10:01 CET 2013

Currently, one of the debug lines in the equalizer module prints out center
frequency values truncated (not rounded) to zero decimal places, and when VLC
is set to use ISO center frequencies, this causes some level of disagreement
between the depiction of the truncated frequencies in the module debug output
and the depiction of the rounded frequencies in the Qt GUI labels.  The 62.5 Hz
ISO center frequency is one of these frequencies, where we have 62 Hz shown in
the debug output and 63 Hz shown in the Qt GUI.  This patch fixes the issue by
displaying the center frequencies in the debug output as real values rounded to
the nearest hundredth.
 modules/audio_filter/equalizer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/audio_filter/equalizer.c b/modules/audio_filter/equalizer.c
index 44a3b25..7e75583 100644
--- a/modules/audio_filter/equalizer.c
+++ b/modules/audio_filter/equalizer.c
@@ -402,8 +402,8 @@ static int EqzInit( filter_t *p_filter, int i_rate )
                         i_rate, p_sys->i_band, p_sys->b_2eqz ? 2 : 1 );
     for( i = 0; i < p_sys->i_band; i++ )
-        msg_Dbg( p_filter, "   %d Hz -> factor:%f alpha:%f beta:%f gamma:%f",
-                 (int)cfg.band[i].f_frequency, p_sys->f_amp[i],
+        msg_Dbg( p_filter, "   %.2f Hz -> factor:%f alpha:%f beta:%f gamma:%f",
+                 cfg.band[i].f_frequency, p_sys->f_amp[i],
                  p_sys->f_alpha[i], p_sys->f_beta[i], p_sys->f_gamma[i]);
     return VLC_SUCCESS;

More information about the vlc-devel mailing list