]> git.sesse.net Git - vlc/commitdiff
Attempt to fix crashes on the extended panel.
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 15 Jun 2008 03:21:11 +0000 (20:21 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 15 Jun 2008 03:21:11 +0000 (20:21 -0700)
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/dialogs/extended.cpp

index 0061ee7d3ffd2a1c985c51ed464bf8660b0d092d..7fb529157367be0afba6467eb8c5f9f28d2b6a4e 100755 (executable)
@@ -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 )
     {
index a19f4a557d545a52319a197c70a6308b45878d56..3e45580c8d4bb4976ee84de2235320d2ba4d6fcd 100644 (file)
@@ -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 );