changeset 7019:e37a67d5e117

fix (?) cmd line handling
author pontscho
date Thu, 15 Aug 2002 22:52:52 +0000
parents 89c0f67785d0
children 04d2443978ae
files Gui/cfg.c Gui/cfg.h Gui/interface.c Gui/interface.h Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/opts.c cfg-mplayer.h configure mplayer.c mplayer.h
diffstat 10 files changed, 144 insertions(+), 175 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/cfg.c	Thu Aug 15 22:45:34 2002 +0000
+++ b/Gui/cfg.c	Thu Aug 15 22:52:52 2002 +0000
@@ -8,6 +8,10 @@
 #include "../mplayer.h"
 #include "../cfgparser.h"
 
+#ifdef USE_SETLOCALE
+#include <locale.h>
+#endif
+
 #include "../../libvo/video_out.h"
 
 #include "cfg.h"
@@ -19,22 +23,10 @@
 
 int    gtkEnableAudioEqualizer = 0;
 
-char * gtkVODriver = NULL;
-int    gtkVODoubleBuffer = 1;
-int    gtkVODirectRendering = 0;
-int    gtkVFrameDrop = 1;
-int    gtkVHardFrameDrop = 0;
-int    gtkVNIAVI = 0;
-int    gtkVFlip = 0;
-int    gtkVIndex = 1;
-int    gtkVVFM = -1;
-int    gtkVAutoq = 0;
-
 int    gtkVopPP = 0;
 int    gtkVopLAVC = 0;
 int    gtkVopFAME = 0;
 
-char * gtkAODriver = NULL;
 int    gtkAONoSound = 0;
 float  gtkAODelay = 0.0f;
 int    gtkAONorm = 0;
@@ -44,14 +36,8 @@
 char * gtkAOOSSMixer;
 char * gtkAOOSSDevice;
 
-int    gtkSubAuto = 1; //
-int    gtkSubUnicode = 0; //
 int    gtkSubDumpMPSub = 0;
 int    gtkSubDumpSrt = 0;
-float  gtkSubDelay = 0.0f;
-float  gtkSubFPS = 0.0f;
-int    gtkSubPos = 100; //
-float  gtkSubFFactor = 0.75;
 
 // ---
 
@@ -64,24 +50,23 @@
 {
  { "enable_audio_equ",&gtkEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
  
- { "vo_driver",&gtkVODriver,CONF_TYPE_STRING,0,0,0,NULL },
+ { "vo_driver",&video_driver,CONF_TYPE_STRING,0,0,0,NULL },
  { "vo_panscan",&vo_panscan,CONF_TYPE_FLOAT,CONF_RANGE,0.0,1.0,NULL },
  { "vo_doublebuffering",&vo_doublebuffering,CONF_TYPE_FLAG,0,0,1,NULL },
- { "vo_direct_render",&gtkVODirectRendering,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "vo_direct_render",&vo_directrendering,CONF_TYPE_FLAG,0,0,1,NULL },
 
- { "v_framedrop",&gtkVFrameDrop,CONF_TYPE_FLAG,0,0,1,NULL },
- { "v_hard_framedrop",&gtkVHardFrameDrop,CONF_TYPE_FLAG,0,0,1,NULL },
- { "v_flip",&gtkVFlip,CONF_TYPE_FLAG,0,0,1,NULL },
- { "v_ni",&gtkVNIAVI,CONF_TYPE_FLAG,0,0,1,NULL },
- { "v_idx",&gtkVIndex,CONF_TYPE_FLAG,0,0,1,NULL },
- { "v_vfm",&gtkVVFM,CONF_TYPE_INT,CONF_RANGE,-1,10,NULL },
+ { "v_framedrop",&frame_dropping,CONF_TYPE_INT,CONF_RANGE,0,2,NULL },
+ { "v_flip",&flip,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "v_ni",&force_ni,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "v_idx",&index_mode,CONF_TYPE_INT,CONF_RANGE,-1,2,NULL },
+ { "v_vfm",&video_family,CONF_TYPE_INT,CONF_RANGE,-1,10,NULL },
 
  { "vf_pp",&gtkVopPP,CONF_TYPE_FLAG,0,0,1,NULL },
- { "vf_autoq",&gtkVAutoq,CONF_TYPE_INT,CONF_RANGE,0,100,NULL },
+ { "vf_autoq",&auto_quality,CONF_TYPE_INT,CONF_RANGE,0,100,NULL },
  { "vf_lavc",&gtkVopLAVC,CONF_TYPE_FLAG,0,0,1,NULL },
  { "vf_fame",&gtkVopFAME,CONF_TYPE_FLAG,0,0,1,NULL },
 
- { "ao_driver",&gtkAODriver,CONF_TYPE_STRING,0,0,0,NULL },
+ { "ao_driver",&audio_driver,CONF_TYPE_STRING,0,0,0,NULL },
  { "ao_nosound",&gtkAONoSound,CONF_TYPE_FLAG,0,0,1,NULL },
  { "ao_volnorm",&gtkAONorm,CONF_TYPE_FLAG,0,0,1,NULL },
  { "ao_surround",&gtkAOSurround,CONF_TYPE_FLAG,0,0,1,NULL },
@@ -92,11 +77,11 @@
  { "ao_oss_device",&gtkAOOSSDevice,CONF_TYPE_STRING,0,0,0,NULL },
  
  { "osd_level",&osd_level,CONF_TYPE_INT,CONF_RANGE,0,2,NULL },
- { "sub_auto_load",&gtkSubAuto,CONF_TYPE_FLAG,0,0,1,NULL },
- { "sub_unicode",&gtkSubUnicode,CONF_TYPE_FLAG,0,0,1,NULL },
- { "sub_pos",&gtkSubPos,CONF_TYPE_INT,CONF_RANGE,0,200,NULL },
- { "font_factor",&gtkSubFFactor,CONF_TYPE_FLOAT,CONF_RANGE,0.0,10.0,NULL },
- { "font_name",&guiIntfStruct.Fontname,CONF_TYPE_STRING,0,0,0,NULL },
+ { "sub_auto_load",&sub_auto,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "sub_unicode",&sub_unicode,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "sub_pos",&sub_pos,CONF_TYPE_INT,CONF_RANGE,0,200,NULL },
+ { "font_factor",&font_factor,CONF_TYPE_FLOAT,CONF_RANGE,0.0,10.0,NULL },
+ { "font_name",&font_name,CONF_TYPE_STRING,0,0,0,NULL },
  
  { "gui_skin",&skinName,CONF_TYPE_STRING,0,0,0,NULL },
 
@@ -166,6 +151,10 @@
  FILE * f;
  int    i;
 
+#ifdef USE_SETLOCALE
+ setlocale( LC_ALL,"" );
+#endif
+
 // -- save configuration 
  if ( (f=fopen( cfg,"wt+" )) )
   {
--- a/Gui/cfg.h	Thu Aug 15 22:45:34 2002 +0000
+++ b/Gui/cfg.h	Thu Aug 15 22:52:52 2002 +0000
@@ -4,23 +4,10 @@
 
 extern int gtkEnableAudioEqualizer;
 
-extern char * gtkVODriver;
-extern int    gtkVODoubleBuffer;
-extern int    gtkVODirectRendering;
-
-extern int    gtkVFrameDrop;
-extern int    gtkVHardFrameDrop;
-extern int    gtkVNIAVI;
-extern int    gtkVFlip;
-extern int    gtkVIndex;
-extern int    gtkVVFM;
-extern int    gtkVAutoq;
-
 extern int    gtkVopPP;
 extern int    gtkVopLAVC;
 extern int    gtkVopFAME;
 
-extern char * gtkAODriver;
 extern int    gtkAONoSound;
 extern float  gtkAODelay;
 extern int    gtkAONorm;
@@ -30,14 +17,8 @@
 extern char * gtkAOOSSMixer;
 extern char * gtkAOOSSDevice;
 
-extern int    gtkSubAuto; 
-extern int    gtkSubUnicode; 
 extern int    gtkSubDumpMPSub;
 extern int    gtkSubDumpSrt;
-extern float  gtkSubDelay;
-extern float  gtkSubFPS;
-extern int    gtkSubPos;
-extern float  gtkSubFFactor;
 
 extern char * gtkEquChannel1;
 extern char * gtkEquChannel2;
--- a/Gui/interface.c	Thu Aug 15 22:45:34 2002 +0000
+++ b/Gui/interface.c	Thu Aug 15 22:52:52 2002 +0000
@@ -66,6 +66,13 @@
  return strcmp( a,b );
 }
 
+int gstrncmp( char * a,char * b,int size )
+{
+ if ( !a && !b ) return 0;
+ if ( !a || !b ) return -1;
+ return strncmp( a,b,size );
+}
+
 char * gstrdup( char * str )
 {
  if ( !str ) return NULL;
@@ -140,11 +147,10 @@
  gtkInit();
  wsXInit( (void *)mDisplay );
      
- cfg_read(); 
+// cfg_read(); 
  appInit( (void*)mDisplay );
        
  if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
- if ( sub_delay != 0.0f ) gtkSubDelay=sub_delay;
  if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name );
 #if defined( USE_OSD ) || defined( USE_SUB )
  guiLoadFont();
@@ -188,18 +194,13 @@
 
 extern ao_functions_t * audio_out;
 extern vo_functions_t * video_out;
-extern int    		flip;
 extern int    		frame_dropping;
-extern int    		sub_pos;
-extern int    		sub_unicode;
 extern int              stream_dump_type;
 extern char **          vo_plugin_args;
-extern int              auto_quality;
 
 #if defined( USE_OSD ) || defined( USE_SUB )
 void guiLoadFont( void )
 {
- font_factor=gtkSubFFactor;
  if ( vo_font )
   {
    int i;
@@ -219,19 +220,19 @@
      }
    free( vo_font ); vo_font=NULL;
   }
- if ( guiIntfStruct.Fontname )
+ if ( font_name )
   {
-   vo_font=read_font_desc( guiIntfStruct.Fontname,font_factor,0 );
+   vo_font=read_font_desc( font_name,font_factor,0 );
    if ( !vo_font ) mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name );
   } 
   else
    {
-    guiIntfStruct.Fontname=gstrdup( get_path( "font/font.desc" ) );
-    vo_font=read_font_desc( guiIntfStruct.Fontname,font_factor,0 );
+    font_name=gstrdup( get_path( "font/font.desc" ) );
+    vo_font=read_font_desc( font_name,font_factor,0 );
     if ( !vo_font )
      {
-      gfree( (void **)&guiIntfStruct.Fontname ); guiIntfStruct.Fontname=gstrdup( DATADIR"/font/font.desc" );
-      vo_font=read_font_desc( guiIntfStruct.Fontname,font_factor,0 );
+      gfree( (void **)&font_name ); font_name=gstrdup( DATADIR"/font/font.desc" );
+      vo_font=read_font_desc( font_name,font_factor,0 );
      }
    }
 }
@@ -431,15 +432,8 @@
 	     }
 	 }
 // -- subtitle
-        gtkSubUnicode=sub_unicode;
-        gtkSubDelay=sub_delay;
-        gtkSubFPS=sub_fps;
-        gtkSubPos=sub_pos;
-#ifdef USE_OSD
-	gtkSubFFactor=font_factor;
-#endif
 #ifdef HAVE_DXR3
-	if ( !gstrcmp( gtkVODriver,"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME )
+	if ( !gstrcmp( video_driver,"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME )
 	 {
 	  gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME );
 	  guiIntfStruct.Playing=0;
@@ -457,30 +451,20 @@
        guiIntfStruct.DiskChanged=0;
 
 // --- video opts
-       if ( !gtkVODriver )
+       
+       if ( !video_driver )
 	{
          int i = 0;
-	 if ( video_driver && !gtkVODriver )
-	  {
-	   while ( video_out_drivers[i] )
-	    if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
-	     {
-	      const vo_info_t *info = video_out_drivers[i - 1]->get_info();
-	      if ( !gstrcmp( video_driver,(char *)info->short_name ) ) gtkVODriver=gstrdup( video_driver );
-	     }
-	  }
-	  else
            while ( video_out_drivers[i++] )
 	    if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) 
 	     {
 	      const vo_info_t *info = video_out_drivers[i - 1]->get_info();
-	      gtkVODriver=gstrdup( (char *)info->short_name );
+	      video_driver=gstrdup( (char *)info->short_name );
 	      break;
 	     }
 	 }
 	
-	if ( gtkVODriver ) { gfree( (void **)&video_driver ); video_driver=gstrdup( gtkVODriver ); }
-	  else { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); }
+	if ( !video_driver ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); }
 
 	{
 	 int i = 0;
@@ -489,7 +473,7 @@
 	  if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) 
 	   {
 	    const vo_info_t *info = video_out_drivers[i - 1]->get_info();
-	    if  ( ( !gstrcmp( gtkVODriver,(char *)info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) ) 
+	    if  ( ( !gstrcmp( video_driver,(char *)info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) ) 
 	      { guiIntfStruct.NoWindow=True; break; }
 	   }
 	}
@@ -497,7 +481,7 @@
 #ifdef HAVE_DXR3
 	remove_vop( "lavc" );
 	remove_vop( "fame" );
-	if ( !gstrcmp( gtkVODriver,"dxr3" ) )
+	if ( !gstrcmp( video_driver,"dxr3" ) )
 	 {
 	  #warning workaround for this moment.
 	  osd_level=0;
@@ -510,16 +494,8 @@
 	 }
 #endif
 // ---	 
-	if ( gtkVopPP ) { add_vop( "pp" ); auto_quality=gtkVAutoq; } 
-	 else { remove_vop( "pp" ); auto_quality=0; }
-
-        vo_doublebuffering=gtkVODoubleBuffer;
-        vo_directrendering=gtkVODirectRendering;
-	frame_dropping=gtkVFrameDrop;
-	if ( gtkVHardFrameDrop ) frame_dropping=gtkVHardFrameDrop;
-	flip=gtkVFlip;
-	force_ni=gtkVNIAVI;
-	video_family=gtkVVFM;
+	if ( gtkVopPP ) add_vop( "pp" );
+	 else remove_vop( "pp" );
 		 
 // --- audio opts
 	audio_delay=gtkAODelay;
@@ -532,25 +508,17 @@
 	  ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul;
 	 }
 	mixer_device=gtkAOOSSMixer;
-	if ( audio_driver && !gtkAODriver ) gtkAODriver=gstrdup( audio_driver );
-	gfree( (void **)&audio_driver );
-	if ( !gstrcmp( gtkAODriver,"oss" ) && gtkAOOSSDevice )
+	if ( !gstrncmp( audio_driver,"oss",3 ) && gtkAOOSSDevice )
 	 {
-	  char * tmp = calloc( 1,strlen( gtkAODriver ) + strlen( gtkAOOSSDevice ) + 2 );
-	  sprintf( tmp,"%s:%s",gtkAODriver,gtkAOOSSDevice ); 
+	  char * tmp = calloc( 1,strlen( gtkAOOSSDevice ) + 5 );
+	  sprintf( tmp,"oss:%s",gtkAOOSSDevice );
+	  gfree( (void *)&audio_driver );
 	  audio_driver=tmp;
-	 } else audio_driver=gstrdup( gtkAODriver );
+	 }
 
 // -- subtitle
 #ifdef USE_SUB
-	sub_auto=0;
-	if ( gtkSubAuto && guiIntfStruct.StreamType == STREAMTYPE_FILE && !guiIntfStruct.Subtitlename )
-	 guiSetFilename( guiIntfStruct.Subtitlename,( guiIntfStruct.Filename ? sub_filename( get_path("sub/"),guiIntfStruct.Filename ): "default.sub" ) );
 	sub_name=guiIntfStruct.Subtitlename;
-        sub_unicode=gtkSubUnicode;
-        sub_delay=gtkSubDelay;
-        sub_fps=gtkSubFPS;
-        sub_pos=gtkSubPos;
 	stream_dump_type=0;
 	if ( gtkSubDumpMPSub ) stream_dump_type=4;
 	if ( gtkSubDumpSrt ) stream_dump_type=6;
@@ -563,7 +531,6 @@
 // --- misc		    
         if ( guiIntfStruct.AudioFile ) audio_stream=guiIntfStruct.AudioFile;
 	  else if ( guiIntfStruct.FilenameChanged ) audio_stream=NULL;
-	index_mode=gtkVIndex;
 	
 	break;
   }
@@ -673,24 +640,20 @@
         return NULL;
 // --- subtitle
    case gtkSetSubAuto:
-        gtkSubAuto=(int)fparam;
+        sub_auto=(int)fparam;
 	return NULL;
    case gtkSetSubDelay:
-//        mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
-//        mp_cmd->id=MP_CMD_SUB_DELAY;    mp_cmd->name=strdup( "sub_delay" );
-//	mp_cmd->args[0].v.f=fparam;   mp_cmd->args[1].v.i=1;
-//	mp_input_queue_cmd( mp_cmd );
-        gtkSubDelay=sub_delay=fparam;
+        sub_delay=fparam;
         return NULL;   
    case gtkSetSubFPS:
-        gtkSubFPS=sub_fps=(int)fparam;
+        sub_fps=(int)fparam;
         return NULL;   
    case gtkSetSubPos:
-        gtkSubPos=sub_pos=(int)fparam;
+        sub_pos=(int)fparam;
         return NULL;   
 #if defined( USE_OSD ) || defined( USE_SUB )
    case gtkSetFontFactor:
-        gtkSubFFactor=fparam;
+        font_factor=fparam;
 	guiLoadFont();
 	return NULL;
 #endif
@@ -724,7 +687,7 @@
 	mp_input_queue_cmd( mp_cmd );
         return NULL;
    case gtkSetAutoq:
-	auto_quality=gtkVAutoq=(int)fparam;
+	auto_quality=(int)fparam;
 	return NULL;
 // --- set equalizers
    case gtkSetContrast:
--- a/Gui/interface.h	Thu Aug 15 22:45:34 2002 +0000
+++ b/Gui/interface.h	Thu Aug 15 22:52:52 2002 +0000
@@ -5,6 +5,7 @@
 #include "../config.h"
 #include "mplayer/play.h"
 #include "../mplayer.h"
+#include "cfg.h"
 
 #ifdef USE_DVDREAD
  #include "../libmpdemux/stream.h"
@@ -91,8 +92,6 @@
    char * Subtitlename;
    int    SubtitleChanged;
    
-   char * Fontname;
-
    char * Othername;
    int    OtherChanged;
    
--- a/Gui/mplayer/gtk/fs.c	Thu Aug 15 22:45:34 2002 +0000
+++ b/Gui/mplayer/gtk/fs.c	Thu Aug 15 22:52:52 2002 +0000
@@ -254,7 +254,7 @@
 	gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
 	g_list_free( fsList_items );
 	gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[fsNumberOfFontFilterNames - 1][0] );
-	tmp=guiIntfStruct.Fontname;
+	tmp=font_name;
 	break;
   }
 
@@ -438,11 +438,11 @@
           guiSetDF( guiIntfStruct.AudioFile,fsSelectedDirectory,fsSelectedFile );
           break;
    case fsFontSelector:
-          guiSetDF( guiIntfStruct.Fontname,fsSelectedDirectory,fsSelectedFile );
+          guiSetDF( font_name,fsSelectedDirectory,fsSelectedFile );
 #if defined( USE_OSD ) || defined( USE_SUB )
 	  guiLoadFont();
 #endif
-	  if ( gtkVPreferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),guiIntfStruct.Fontname );
+	  if ( gtkVPreferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
 	  break;
   }
 
--- a/Gui/mplayer/gtk/opts.c	Thu Aug 15 22:45:34 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Thu Aug 15 22:52:52 2002 +0000
@@ -121,12 +121,11 @@
   int    i = 0;
   char * tmp[3]; tmp[2]="";
   old_audio_driver=0;
-  if ( audio_driver && !gtkAODriver ) gtkAODriver=gstrdup( audio_driver );
   while ( audio_out_drivers[i] )
    {
     const ao_info_t *info = audio_out_drivers[i++]->info;
     if ( !strcmp( info->short_name,"plugin" ) ) continue;
-    if ( !gstrcmp( gtkAODriver,(char *)info->short_name ) ) old_audio_driver=i - 1;
+    if ( !gstrcmp( audio_driver,(char *)info->short_name ) ) old_audio_driver=i - 1;
     tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp );
    }
   gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 );
@@ -138,31 +137,28 @@
  }
 
 // -- 2. page
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),gtkVODoubleBuffer );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),gtkVODirectRendering );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),gtkVFrameDrop );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),gtkVHardFrameDrop );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFlip ),gtkVFlip );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),vo_doublebuffering );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),vo_directrendering );
+
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),FALSE );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),FALSE );
+ switch ( frame_dropping )
+  {
+   case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),TRUE );
+   case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),TRUE );
+  }
+
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFlip ),flip );
  gtk_adjustment_set_value( HSPanscanadj,vo_panscan );
  {
   int i = 0, c = 0;
   char * tmp[3]; tmp[2]="";
   old_video_driver=0; 
-  if ( video_driver && !gtkVODriver )
-   {
-    while ( video_out_drivers[i] )
-     if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
-      {
-       const vo_info_t *info = video_out_drivers[i - 1]->get_info(); 
-       if ( !gstrcmp( video_driver,(char *)info->short_name ) ) gtkVODriver=gstrdup( video_driver );
-      }
-   }
-  i=0;
   while ( video_out_drivers[i] )
    if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
     { 
      const vo_info_t *info = video_out_drivers[i - 1]->get_info();
-     if ( !gstrcmp( gtkVODriver,(char *)info->short_name ) ) old_video_driver=c; c++;
+     if ( !gstrcmp( video_driver,(char *)info->short_name ) ) old_video_driver=c; c++;
      tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLVDrivers ),tmp );
     }
   gtk_clist_select_row( GTK_CLIST( CLVDrivers ),old_video_driver,0 );
@@ -174,14 +170,14 @@
  }
 
 // -- 3. page
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ),!gtkSubAuto );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ),!sub_auto );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ),gtkSubDumpMPSub );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpSrt ),gtkSubDumpSrt );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubUnicode ),gtkSubUnicode );
- gtk_adjustment_set_value( HSSubDelayadj,gtkSubDelay );
- gtk_adjustment_set_value( HSSubFPSadj,gtkSubFPS );
- gtk_adjustment_set_value( HSSubPositionadj,gtkSubPos );
- gtk_adjustment_set_value( HSFontFactoradj,gtkSubFFactor );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubUnicode ),sub_unicode );
+ gtk_adjustment_set_value( HSSubDelayadj,sub_delay );
+ gtk_adjustment_set_value( HSSubFPSadj,sub_fps );
+ gtk_adjustment_set_value( HSSubPositionadj,sub_pos );
+ gtk_adjustment_set_value( HSFontFactoradj,font_factor );
  switch ( osd_level )
   {
    case 0: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDNone ),TRUE ); break;
@@ -191,17 +187,17 @@
 #if 0
  if ( guiIntfStruct.Subtitlename ) gtk_entry_set_text( GTK_ENTRY( ESubtitleName ),guiIntfStruct.Subtitlename );
 #endif
- if ( guiIntfStruct.Fontname ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),guiIntfStruct.Fontname );
+ if ( font_name ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
 
 // -- 4. page
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),gtkVNIAVI );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),gtkVIndex );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),force_ni );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),index_mode );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP );
- gtk_adjustment_set_value( HSPPQualityadj,gtkVAutoq );
+ gtk_adjustment_set_value( HSPPQualityadj,auto_quality );
  {
   int i = 0;
   for ( i=0;i<7;i++ )
-    if ( lVFM[i].vfm == gtkVVFM ) break;
+    if ( lVFM[i].vfm == video_family ) break;
   gtk_entry_set_text( GTK_ENTRY( EVFM ),lVFM[i].name );
  }
 
@@ -289,23 +285,26 @@
 	gtkAONoSound=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoSound ) );
 	gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
 	gtkSet( gtkSetAudioDelay,HSAudioDelayadj->value,NULL );
-        gfree( (void **)&gtkAODriver );
-	gtkAODriver=gstrdup( ao_driver[0] );
-	gfree( (void **)&gtkVODriver );
-	gtkVODriver=gstrdup( vo_driver[0] );
+        gfree( (void **)&audio_driver );
+	audio_driver=gstrdup( ao_driver[0] );
+	gfree( (void **)&video_driver );
+	video_driver=gstrdup( vo_driver[0] );
 
 	// -- 2. page
-	gtkVODoubleBuffer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) );
-	gtkVODirectRendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) );
-	gtkVFrameDrop=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) );
-	gtkVHardFrameDrop=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBHFramedrop ) );
-	gtkVFlip=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFlip ) );
+	vo_doublebuffering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) );
+	vo_directrendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) );
+
+        frame_dropping=0;
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) ) == TRUE ) frame_dropping=1;
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBHFramedrop ) ) == TRUE ) frame_dropping=2;
+
+	flip=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFlip ) );
 	
 	// -- 3. page
 	gtkSet( gtkSetSubAuto,!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ) ),NULL );
 	gtkSubDumpMPSub=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ) );
 	gtkSubDumpSrt=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpSrt ) );
-	gtkSubUnicode=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubUnicode ) );
+	sub_unicode=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubUnicode ) );
 	gtkSet( gtkSetSubDelay,HSSubDelayadj->value,NULL );
 	gtkSet( gtkSetSubFPS,HSSubFPSadj->value,NULL );
 	gtkSet( gtkSetSubPos,HSSubPositionadj->value,NULL );
@@ -313,19 +312,19 @@
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDNone ) ) ) osd_level=0;
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ) ) ) osd_level=1;
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTandP ) ) ) osd_level=2;
-	guiSetFilename( guiIntfStruct.Fontname,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) );
+	guiSetFilename( font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) );
 
 	// -- 4. page
-	gtkVNIAVI=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ) );
-	gtkVIndex=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBIndex ) );
+	force_ni=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ) );
+	index_mode=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBIndex ) );
 	gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); 
 	gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL );
 	{
 	 int i;
 	 char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) );
-	 gtkVVFM=-1;
+	 video_family=-1;
 	 for ( i=0;i<7;i++ )
-	  if ( !strcmp( tmp,lVFM[i].name ) ) { gtkVVFM=lVFM[i].vfm; break; }
+	  if ( !strcmp( tmp,lVFM[i].name ) ) { video_family=lVFM[i].vfm; break; }
 	}
 
    case bCancel:
--- a/cfg-mplayer.h	Thu Aug 15 22:45:34 2002 +0000
+++ b/cfg-mplayer.h	Thu Aug 15 22:52:52 2002 +0000
@@ -322,8 +322,8 @@
 	{"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, 
 #endif
 
-	{"gui", &use_gui, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
-	{"nogui", &use_gui, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
+	{"gui", &use_gui, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCMD, 0, 1, NULL},
+//	{"nogui", &use_gui, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
       
 #ifdef HAVE_NEW_GUI
 	{"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
--- a/configure	Thu Aug 15 22:45:34 2002 +0000
+++ b/configure	Thu Aug 15 22:52:52 2002 +0000
@@ -160,6 +160,7 @@
   --disable-new-input    disable new input system [enable]
   --enable-joystick      enable joystick support in new input [disable]
   --enable-i18n          GNU internationalisation [disable]
+  --disable-setlocale    disable setlocale using in mplayer [autodetect]
   --enable-runtime-cpudetection    Enable runtime CPU detection [disable]
   --disable-dvdnav       Disable dvdnav support [autodetect]
   --disable-dvdread      Disable libdvdread support [autodetect]
@@ -975,6 +976,7 @@
 _shm=auto
 _linux_devfs=no
 _i18n=no
+_setlocale=auto
 _sighandler=yes
 _libdv=auto
 _cdparanoia=auto
@@ -1000,6 +1002,8 @@
   --disable-mencoder)	_mencoder=no	;;
   --enable-i18n)	_i18n=yes	;;
   --disable-i18n)	_i18n=no	;;
+  --enable-setlocale)   _setlocale=yes  ;;
+  --disable-setlocale)  _setlocale=no   ;;
   --enable-x11)		_x11=yes	;;
   --disable-x11)	_x11=no		;;
   --enable-xv)		_xv=yes		;;
@@ -1427,6 +1431,26 @@
 echores "$_i18n"
 
 
+# Checking for setlocale() ...
+# CSAK EGY MARADHAT - A HEGYLAKO
+# Nemnem. a TV Maci !
+echocheck "setlocale()"
+if test "$_setlocale" = auto ; then
+  cat > $TMPC <<EOF
+#include <locale.h>
+int main(void) { setlocale( LC_ALL,"" ); return 0; }
+EOF
+  _setlocale=no
+  cc_check && _setlocale=yes
+fi
+if test "$_setlocale" = yes ; then
+  _def_setlocale='#define USE_SETLOCALE 1'
+else
+  _def_setlocale='#undef USE_SETLOCALE'
+fi
+echores "$_setlocale"
+
+
 echocheck "language"
 test -z "$LINGUAS" && LINGUAS="en"
 if test -f "help_mp-${LINGUAS}.h" ; then
@@ -4257,6 +4281,9 @@
 /* use GNU internationalization */
 $_def_i18n
 
+/* use setlocale() function */
+$_def_setlocale
+
 /* Runtime CPU detection */
 $_def_runtime_cpudetection
 
--- a/mplayer.c	Thu Aug 15 22:45:34 2002 +0000
+++ b/mplayer.c	Thu Aug 15 22:52:52 2002 +0000
@@ -582,7 +582,9 @@
     mp_register_options(mconfig);
     parse_cfgfiles(mconfig);
 
-
+#ifdef HAVE_NEW_GUI
+    if ( use_gui ) cfg_read();
+#endif
 
     if(m_config_parse_command_line(mconfig, argc, argv, envp) < 0) exit(1); // error parsing cmdline
 
--- a/mplayer.h	Thu Aug 15 22:45:34 2002 +0000
+++ b/mplayer.h	Thu Aug 15 22:52:52 2002 +0000
@@ -23,9 +23,18 @@
 extern float  sub_delay;
 extern float  sub_fps;
 extern int    sub_auto;
+extern int    sub_pos;
+extern int    sub_unicode;
 
 extern char * filename;
 
+extern int flip;
+extern int force_ni;
+extern int index_mode;
+extern int frame_dropping;
+
+extern int auto_quality;
+
 extern void exit_player(char* how);
 
 #endif