[vlc-devel] commit: Attempt to fix crashes on the extended panel. (Jean-Baptiste Kempf )

git version control git at videolan.org
Sun Jun 15 05:20:13 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Jun 14 20:21:11 2008 -0700| [7d723b44f45faeb3f9c6806f270f2fe2cd7afd50]

Attempt to fix crashes on the extended panel.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7d723b44f45faeb3f9c6806f270f2fe2cd7afd50
---

 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 0061ee7..7fb5291 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 a19f4a5..3e45580 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 );
 




More information about the vlc-devel mailing list