[MPlayer-dev-eng] [PATCH] GUI: segfault in sb.c; window size & localization in eq.c;

Stanislav Maslovski stanislav.maslovski at gmail.com
Thu Apr 6 21:12:14 CEST 2006


Hello,

The attached patch fixes the following issues in MPlayer's GTK+ GUI:

 * segfault in the skin browser when sbSelectedSkin gets dereferenced
   before setting, when no skin is selected in the skin list upon opening
   the browser, and "Cancel" or "OK" buttons get clicked. Noticed when
   runnig freshly compiled gmplayer on a system where the skins were
   still under the old location.
   
 * vertical size of "Configure Equalizer" window was not enough to hold all
   comboboxes.
   
 * the title of this window was not localized => added new en and ru strings.

BR,
Stanislav
-------------- next part --------------
Index: Gui/mplayer/gtk/eq.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/eq.c,v
retrieving revision 1.18
diff -u -u -r1.18 eq.c
--- Gui/mplayer/gtk/eq.c	9 Dec 2005 12:51:13 -0000	1.18
+++ Gui/mplayer/gtk/eq.c	6 Apr 2006 09:57:33 -0000
@@ -562,9 +562,9 @@
   EquConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( EquConfig,"EquConfig" );
   gtk_object_set_data( GTK_OBJECT( EquConfig ),"EquConfig",EquConfig );
-  gtk_widget_set_usize( EquConfig,350,198 );
+  gtk_widget_set_usize( EquConfig,350,260 );
   GTK_WIDGET_SET_FLAGS( EquConfig,GTK_CAN_DEFAULT );
-  gtk_window_set_title( GTK_WINDOW( EquConfig ),"Configure Equalizer" );
+  gtk_window_set_title( GTK_WINDOW( EquConfig ),MSGTR_ConfigureEqualizer );
   gtk_window_set_position( GTK_WINDOW( EquConfig ),GTK_WIN_POS_CENTER );
 //  gtk_window_set_modal( GTK_WINDOW( EquConfig ),TRUE );
   gtk_window_set_policy( GTK_WINDOW( EquConfig ),FALSE,FALSE,FALSE );
Index: Gui/mplayer/gtk/sb.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/sb.c,v
retrieving revision 1.19
diff -u -u -r1.19 sb.c
--- Gui/mplayer/gtk/sb.c	27 Mar 2006 11:39:26 -0000	1.19
+++ Gui/mplayer/gtk/sb.c	6 Apr 2006 09:57:33 -0000
@@ -24,8 +24,8 @@
 char      * sbMPlayerPrefixDir=NULL;
 char      * sbMPlayerPrefixDir_obsolete=NULL;
 
-char * gtkOldSkin;
-static char * prev;
+char * gtkOldSkin=NULL;
+static char * prev=NULL;
 
 GtkWidget * SkinBrowser = NULL;
 
@@ -77,17 +77,20 @@
 
 static void prButton( GtkObject * object,gpointer user_data )
 {
- switch ( (int)user_data )
-  {
-   case 0: // cancel
+ if ( sbSelectedSkin )
+ {
+  switch ( (int)user_data )
+   {
+    case 0: // cancel
 	if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
 	break;
-   case 1: // ok
+    case 1: // ok
 	ChangeSkin( sbSelectedSkin );
 	if ( skinName ) free( skinName );
 	skinName=strdup( sbSelectedSkin );
 	break;   
   }
+ }
  HideSkinBrowser();
 }
 
Index: help/help_mp-en.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v
retrieving revision 1.237
diff -u -u -r1.237 help_mp-en.h
--- help/help_mp-en.h	31 Mar 2006 06:22:51 -0000	1.237
+++ help/help_mp-en.h	6 Apr 2006 09:57:44 -0000
@@ -690,6 +690,7 @@
 // Note: If you change MSGTR_PlayList please see if it still fits MSGTR_MENU_PlayList
 #define MSGTR_PlayList "Playlist"
 #define MSGTR_Equalizer "Equalizer"
+#define MSGTR_ConfigureEqualizer "Configure Equalizer"
 #define MSGTR_SkinBrowser "Skin Browser"
 #define MSGTR_Network "Network streaming..."
 // Note: If you change MSGTR_Preferences please see if it still fits MSGTR_MENU_Preferences
Index: help/help_mp-ru.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-ru.h,v
retrieving revision 1.59
diff -u -u -r1.59 help_mp-ru.h
--- help/help_mp-ru.h	28 Mar 2006 16:37:09 -0000	1.59
+++ help/help_mp-ru.h	6 Apr 2006 09:57:52 -0000
@@ -588,6 +588,7 @@
 #define MSGTR_FontSelect "????? ??????..."
 #define MSGTR_PlayList "????????"
 #define MSGTR_Equalizer "??????????"
+#define MSGTR_ConfigureEqualizer "????????? ???????"
 #define MSGTR_SkinBrowser "??????????? ??????"
 #define MSGTR_Network "??????? ??????..."
 #define MSGTR_Preferences "?????????"


More information about the MPlayer-dev-eng mailing list