changeset 7706:90044efe01ee

- better dxr3 support - fix oss subdevice bug - add some warning fix from Dominik Mierzejewski <dominik@rangers.eu.org>
author pontscho
date Thu, 10 Oct 2002 14:06:49 +0000
parents 844246b6c3bf
children b3c7c62c106c
files Gui/cfg.c Gui/cfg.h Gui/interface.c Gui/interface.h Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/opts.c Gui/wm/ws.c
diffstat 7 files changed, 44 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/cfg.c	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/cfg.c	Thu Oct 10 14:06:49 2002 +0000
@@ -36,6 +36,10 @@
 char * gtkAOOSSMixer;
 char * gtkAOOSSDevice;
 
+#ifdef HAVE_DXR3
+ char * gtkDXR3Device;
+#endif
+
 int    gtkSubDumpMPSub = 0;
 int    gtkSubDumpSrt = 0;
 
@@ -56,6 +60,9 @@
  { "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",&vo_directrendering,CONF_TYPE_FLAG,0,0,1,NULL },
+#ifdef HAVE_DXR3
+ { "vo_dxr3_device",&gtkDXR3Device,CONF_TYPE_STRING,0,0,0,NULL },
+#endif
 
  { "v_framedrop",&frame_dropping,CONF_TYPE_INT,CONF_RANGE,0,2,NULL },
  { "v_flip",&flip,CONF_TYPE_INT,CONF_RANGE,-1,1,NULL },
@@ -221,7 +228,7 @@
 	    }
        case CONF_TYPE_STRING_LIST:
             {
-	     char ** tmp = *( (char **)gui_opts[i].p );
+	     char ** tmp = *( (char ***)gui_opts[i].p );
 	     if ( tmp && tmp[0] && tmp[0][0] ) fprintf( f,"%s = \"%s\"\n",gui_opts[i].name,tmp[0] );
 	     break;
 	    }
--- a/Gui/cfg.h	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/cfg.h	Thu Oct 10 14:06:49 2002 +0000
@@ -16,6 +16,7 @@
 extern float  gtkAOExtraStereoMul;
 extern char * gtkAOOSSMixer;
 extern char * gtkAOOSSDevice;
+extern char * gtkDXR3Device;
 
 extern int    gtkSubDumpMPSub;
 extern int    gtkSubDumpSrt;
--- a/Gui/interface.c	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/interface.c	Thu Oct 10 14:06:49 2002 +0000
@@ -155,14 +155,13 @@
  guiIntfStruct.StreamType=-1;
 
  memset( &gtkEquChannels,0,sizeof( gtkEquChannels ) );
- gtkAOOSSMixer=strdup( PATH_DEV_MIXER );
- gtkAOOSSDevice=strdup( PATH_DEV_DSP );
+ if ( !gtkAOOSSMixer ) gtkAOOSSMixer=strdup( PATH_DEV_MIXER );
+ if ( !gtkAOOSSDevice ) gtkAOOSSDevice=strdup( PATH_DEV_DSP );
+ if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" );
  fullscreen=gtkLoadFullscreen;       
    
  gtkInit();
  wsXInit( (void *)mDisplay );
-     
-// cfg_read(); 
  appInit( (void*)mDisplay );
 
  if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
--- a/Gui/interface.h	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/interface.h	Thu Oct 10 14:06:49 2002 +0000
@@ -139,6 +139,7 @@
 extern int  guiGetEvent( int type,char * arg );
 extern void guiEventHandling( void );
 extern void guiLoadFont( void );
+extern void guiLoadSubtitle( char * name );
 
 typedef struct _plItem 
 {
--- a/Gui/mplayer/gtk/fs.c	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/mplayer/gtk/fs.c	Thu Oct 10 14:06:49 2002 +0000
@@ -539,7 +539,6 @@
  GtkWidget     * hseparator2;
  GtkWidget     * hseparator3;
  GtkWidget     * hbuttonbox3;
- int             i;
 
  GtkWidget     * uppixmapwid;
  GdkPixmap     * uppixmap;
--- a/Gui/mplayer/gtk/opts.c	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Thu Oct 10 14:06:49 2002 +0000
@@ -173,14 +173,20 @@
    {
     const ao_info_t *info = audio_out_drivers[i++]->info;
     if ( !strcmp( info->short_name,"plugin" ) ) continue;
-    if ( audio_driver_list && !gstrcmp( audio_driver_list[0],(char *)info->short_name ) ) old_audio_driver=i - 1;
+    if ( audio_driver_list )
+     {
+      char * name = gstrdup( audio_driver_list[0] );
+      char * sep = strchr( audio_driver_list[0],':' );
+      if ( sep ) *sep=0;
+      if ( !gstrcmp( name,(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 );
   gtk_clist_get_text( GTK_CLIST( CLADrivers ),old_audio_driver,0,(char **)&ao_driver );
   gtk_widget_set_sensitive( AConfig,FALSE );
 #ifdef USE_OSS_AUDIO
-  if ( !gstrcmp( ao_driver[0],"oss" ) ) gtk_widget_set_sensitive( AConfig,TRUE );
+  if ( !strncmp( ao_driver[0],"oss",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
 #endif
  }
 
@@ -493,7 +499,7 @@
    case bAConfig:
         gtk_widget_set_sensitive( AConfig,FALSE );
 #ifdef USE_OSS_AUDIO
-        if ( !strcmp( ao_driver[0],"oss" ) ) { ShowOSSConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); }
+        if ( !strncmp( ao_driver[0],"oss",3 ) ) { ShowOSSConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); }
 #endif
 	break;
    case bVconfig:
@@ -591,7 +597,7 @@
 	gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver ); 
 	gtk_widget_set_sensitive( AConfig,FALSE );
 #ifdef USE_OSS_AUDIO
-	if ( !strcmp( ao_driver[0],"oss" ) ) gtk_widget_set_sensitive( AConfig,TRUE );
+	if ( !strncmp( ao_driver[0],"oss",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
 #endif
 	break;
    case 1: // video driver 
@@ -1936,10 +1942,8 @@
  if ( gtkVOSSConfig ) gtkActive( OSSConfig );
    else OSSConfig=create_OSSConfig();
 
- if ( gtkAOOSSMixer ) gtk_entry_set_text( GTK_ENTRY( CEOssMixer ),gtkAOOSSMixer );
-   else gtk_entry_set_text( GTK_ENTRY( CEOssMixer ),PATH_DEV_MIXER );
- if ( gtkAOOSSDevice ) gtk_entry_set_text( GTK_ENTRY( CEOssDevice ),gtkAOOSSDevice );
-   else gtk_entry_set_text( GTK_ENTRY( CEOssDevice ),PATH_DEV_DSP );
+ gtk_entry_set_text( GTK_ENTRY( CEOssMixer ),gtkAOOSSMixer );
+ gtk_entry_set_text( GTK_ENTRY( CEOssDevice ),gtkAOOSSDevice );
 
  gtk_widget_show( OSSConfig );
  gtkSetLayer( OSSConfig );
@@ -1965,8 +1969,8 @@
  switch( (int)user_data )
   {
    case 1:
-        if ( gtkAOOSSMixer ) free( gtkAOOSSMixer );   gtkAOOSSMixer=strdup( gtk_entry_get_text( GTK_ENTRY( CEOssMixer ) ) );
-        if ( gtkAOOSSDevice ) free( gtkAOOSSDevice ); gtkAOOSSDevice=strdup( gtk_entry_get_text( GTK_ENTRY( CEOssDevice ) ) );
+        gfree( (void **)&gtkAOOSSMixer );  gtkAOOSSMixer=strdup( gtk_entry_get_text( GTK_ENTRY( CEOssMixer ) ) );
+        gfree( (void **)&gtkAOOSSDevice ); gtkAOOSSDevice=strdup( gtk_entry_get_text( GTK_ENTRY( CEOssDevice ) ) );
    case 0:
 	HideOSSConfig();
 	break;
@@ -2080,6 +2084,13 @@
   CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/dsp1" );
   CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/dsp2" );
   CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/dsp3" );
+#ifdef HAVE_DXR3
+  CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/em8300_ma" );
+  CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/em8300_ma-0" );
+  CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/em8300_ma-1" );
+  CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/em8300_ma-2" );
+  CBOssDevice_items=g_list_append( CBOssDevice_items,(gpointer)"/dev/em8300_ma-3" );
+#endif
   gtk_combo_set_popdown_strings( GTK_COMBO( CBOssDevice ),CBOssDevice_items );
   g_list_free( CBOssDevice_items );
 
@@ -2088,7 +2099,6 @@
   gtk_widget_ref( CEOssDevice );
   gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"CEOssDevice",CEOssDevice,(GtkDestroyNotify)gtk_widget_unref );
   gtk_widget_show( CEOssDevice );
-//  gtk_entry_set_text( GTK_ENTRY( CEOssDevice ),"/dev/dsp" );
 
   CBOssMixer=gtk_combo_new();
   gtk_widget_set_name( CBOssMixer,"CBOssMixer" );
@@ -2109,7 +2119,6 @@
   gtk_widget_ref( CEOssMixer );
   gtk_object_set_data_full( GTK_OBJECT( OSSConfig ),"CEOssMixer",CEOssMixer,(GtkDestroyNotify)gtk_widget_unref );
   gtk_widget_show( CEOssMixer );
-//  gtk_entry_set_text( GTK_ENTRY( CEOssMixer ),"/dev/mixer" );
 
   hseparator3=gtk_hseparator_new();
   gtk_widget_set_name( hseparator3,"hseparator3" );
@@ -2184,6 +2193,8 @@
  if ( gtkVDXR3Config ) gtkActive( DXR3Config );
   else DXR3Config=create_DXR3Config();
 
+ gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),gtkDXR3Device );
+
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE );
  if ( gtkVopLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE );
  if ( gtkVopFAME ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVFame ),TRUE );
@@ -2206,6 +2217,7 @@
  switch ( (int)user_data )
  {
   case 0: // Ok
+       gfree( (void **)&gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) );
        gtkVopLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) );
        gtkVopFAME=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVFame ) );
   case 2: // Destroy
@@ -2326,6 +2338,10 @@
  gtk_widget_show( CBDevice );
  gtk_box_pack_start( GTK_BOX( hbox1 ),CBDevice,TRUE,TRUE,0 );
  CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" );
+ CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-0" );
+ CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-1" );
+ CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-2" );
+ CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-3" );
  gtk_combo_set_popdown_strings( GTK_COMBO( CBDevice ),CBDevice_items );
  g_list_free( CBDevice_items );
 
--- a/Gui/wm/ws.c	Thu Oct 10 12:47:33 2002 +0000
+++ b/Gui/wm/ws.c	Thu Oct 10 14:06:49 2002 +0000
@@ -93,8 +93,8 @@
 
 typedef void(*wsTConvFunc)( const unsigned char * in_pixels, unsigned char * out_pixels, unsigned num_pixels );
 wsTConvFunc wsConvFunc = NULL;
-																															
-void rgb32torgb32( const unsigned char * src, unsigned char * dst,int src_size )
+										
+void rgb32torgb32( const unsigned char * src, unsigned char * dst,unsigned int src_size )																					
 { memcpy( dst,src,src_size ); }
 
 // ---
@@ -776,7 +776,7 @@
  Atom            type;
  int             format;
  unsigned long   nitems, bytesafter;
- Atom          * args = NULL;
+ unsigned char * args = NULL;
 
  if ( wsWMType == wsWMIceWM )
   {