From 7d723b44f45faeb3f9c6806f270f2fe2cd7afd50 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sat, 14 Jun 2008 20:21:11 -0700 Subject: [PATCH] Attempt to fix crashes on the extended panel. --- modules/gui/qt4/components/extended_panels.cpp | 17 +++++++++++------ modules/gui/qt4/dialogs/extended.cpp | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp index 0061ee7d3f..7fb5291573 100755 --- a/modules/gui/qt4/components/extended_panels.cpp +++ b/modules/gui/qt4/components/extended_panels.cpp @@ -941,7 +941,7 @@ void Equalizer::setBand() for( int i = 0 ; i< BANDS ; i++ ) { - char psz_val[5]; + char psz_val[8]; float f_val = ( float )( bands[i]->value() ) / 10 - 20 ; sprintf( psz_values, "%s %f", psz_values, f_val ); sprintf( psz_val, "% 5.1f", f_val ); @@ -962,9 +962,9 @@ void Equalizer::setValues( char *psz_bands, float f_preamp ) char *p = psz_bands; if ( p ) { - for( int i = 0; i < 10; i++ ) + for( int i = 0; i < BANDS; i++ ) { - char psz_val[5]; + char psz_val[8]; float f = strtof( p, &p ); int i_val= ( int )( ( f + 20 ) * 10 ); bands[i]->setValue( i_val ); @@ -989,9 +989,14 @@ void Equalizer::setPreset( int preset ) VLC_OBJECT_AOUT, FIND_ANYWHERE ); char psz_values[102]; memset( psz_values, 0, 102 ); - for( int i = 0 ; i< 10 ;i++ ) - sprintf( psz_values, "%s %.1f", psz_values, - eqz_preset_10b[preset]->f_amp[i] ); + char psz_values2[102];memset( psz_values2, 0, 102 ); + for( int i = 0 ; i< BANDS ;i++ ) + { + strcpy( psz_values2, psz_values ); + + sprintf( psz_values, "%s %5.1f", + psz_values2, eqz_preset_10b[preset]->f_amp[i] ); + } if( p_aout ) { diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp index a19f4a557d..3e45580c8d 100644 --- a/modules/gui/qt4/dialogs/extended.cpp +++ b/modules/gui/qt4/dialogs/extended.cpp @@ -41,6 +41,8 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) setWindowTitle( qtr( "Adjustments and Effects" ) ); QGridLayout *layout = new QGridLayout( this ); + layout->setLayoutMargins( 0, 2, 0, 1, 1 ); + layout->setSpacing( 3 ); QTabWidget *mainTabW = new QTabWidget( this ); -- 2.39.2