[vlc-devel] [PATCH] Fixes occasional corruption of "equalizer-bands"

Laurent Aimar fenrir at elivagar.org
Fri Jun 17 20:42:11 CEST 2011


On Sat, Jun 18, 2011 at 12:07:39AM +0530, akash mehrotra wrote:
> Fixes occasional corruption of "equalizer-bands"


> diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
> index b3f5501..d58a164 100644
> --- a/modules/gui/qt4/components/extended_panels.cpp
> +++ b/modules/gui/qt4/components/extended_panels.cpp
> @@ -1060,9 +1061,10 @@ char * Equalizer::createValuesFromPreset( int i_preset )
>      /* Create the QString in Qt */
>      for( int i = 0 ; i< BANDS ;i++ )
>          values += QString( " %1" ).arg( eqz_preset_10b[i_preset]->f_amp[i] );
> -
> +    std::string s = values.toStdString();
> +    const char *psz_values=s.c_str();
>      /* Convert it to char * */
> -    return strdup( values.toAscii().constData() );
> +    return strdup( psz_values );
 I don't think this one is needed as the temporary object is only destroy 
at the end of the scope (ie when strdup() has returned).

-- 
fenrir



More information about the vlc-devel mailing list