[Mplayer-cvslog] CVS: main/Gui cfg.c,1.16,1.17 interface.c,1.50,1.51 interface.h,1.26,1.27

Zoltan Ponekker pontscho at mplayerhq.hu
Wed Oct 2 15:16:17 CEST 2002


Update of /cvsroot/mplayer/main/Gui
In directory mail:/var/tmp.root/cvs-serv29164/Gui

Modified Files:
	cfg.c interface.c interface.h 
Log Message:


add [video||audio]_driver_list


Index: cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/cfg.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- cfg.c	28 Sep 2002 19:42:07 -0000	1.16
+++ cfg.c	2 Oct 2002 13:16:14 -0000	1.17
@@ -52,7 +52,7 @@
 {
  { "enable_audio_equ",&gtkEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
  
- { "vo_driver",&video_driver,CONF_TYPE_STRING,0,0,0,NULL },
+ { "vo_driver",&video_driver_list,CONF_TYPE_STRING_LIST,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",&vo_directrendering,CONF_TYPE_FLAG,0,0,1,NULL },
@@ -69,7 +69,7 @@
  { "vf_lavc",&gtkVopLAVC,CONF_TYPE_FLAG,0,0,1,NULL },
  { "vf_fame",&gtkVopFAME,CONF_TYPE_FLAG,0,0,1,NULL },
 
- { "ao_driver",&audio_driver,CONF_TYPE_STRING,0,0,0,NULL },
+ { "ao_driver",&audio_driver_list,CONF_TYPE_STRING_LIST,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 },

Index: interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- interface.c	28 Sep 2002 19:42:07 -0000	1.50
+++ interface.c	2 Oct 2002 13:16:14 -0000	1.51
@@ -90,6 +90,21 @@
    else gstrcat( str,what );
 }
 
+void gaddlist( char *** list,char * entry )
+{
+ int i;
+
+ if ( (*list) )
+  {
+   for ( i=0;(*list)[i];i++ ) free( (*list)[i] );
+   free( (*list) );
+  }
+
+ (*list)=malloc( 8 );
+ (*list)[0]=gstrdup( entry );
+ (*list)[1]=NULL;
+}
+
 #ifdef USE_ICONV
 char * gconvert_uri_to_filename( char * str )
 {
@@ -462,7 +477,7 @@
 	 }
 // -- subtitle
 #ifdef HAVE_DXR3
-	if ( !gstrcmp( video_driver,"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME )
+	if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) && guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS && !gtkVopLAVC && !gtkVopFAME )
 	 {
 	  gtkMessageBox( GTK_MB_FATAL,MSGTR_NEEDLAVCFAME );
 	  guiIntfStruct.Playing=0;
@@ -481,19 +496,19 @@
 
 // --- video opts
        
-       if ( !video_driver )
+       if ( !video_driver_list )
 	{
          int i = 0;
            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();
-	      video_driver=gstrdup( (char *)info->short_name );
+	      gaddlist( &video_driver_list,(char *)info->short_name );
 	      break;
 	     }
 	 }
 	
-	if ( !video_driver ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); }
+	if ( !video_driver_list && !video_driver_list[0] ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); }
 
 	{
 	 int i = 0;
@@ -502,7 +517,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( video_driver,(char *)info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) ) 
+	    if  ( ( video_driver_list && !gstrcmp( video_driver_list[0],(char *)info->short_name ) )&&( video_out_drivers[i - 1]->control( VOCTRL_GUI_NOWINDOW,NULL ) == VO_TRUE ) ) 
 	      { guiIntfStruct.NoWindow=True; break; }
 	   }
 	}
@@ -510,7 +525,7 @@
 #ifdef HAVE_DXR3
 	remove_vop( "lavc" );
 	remove_vop( "fame" );
-	if ( !gstrcmp( video_driver,"dxr3" ) )
+	if ( video_driver_list && !gstrcmp( video_driver_list[0],"dxr3" ) )
 	 {
 	  if ( ( guiIntfStruct.StreamType != STREAMTYPE_DVD)&&( guiIntfStruct.StreamType != STREAMTYPE_VCD ) )
 	   {
@@ -534,12 +549,11 @@
 	  ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul;
 	 }
 	mixer_device=gtkAOOSSMixer;
-	if ( !gstrncmp( audio_driver,"oss",3 ) && gtkAOOSSDevice )
+	if ( audio_driver_list && !gstrncmp( audio_driver_list[0],"oss",3 ) && gtkAOOSSDevice )
 	 {
 	  char * tmp = calloc( 1,strlen( gtkAOOSSDevice ) + 5 );
 	  sprintf( tmp,"oss:%s",gtkAOOSSDevice );
-	  gfree( (void *)&audio_driver );
-	  audio_driver=tmp;
+	  gaddlist( &audio_driver_list,tmp );
 	 }
 
 // -- subtitle

Index: interface.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- interface.h	28 Sep 2002 18:03:32 -0000	1.26
+++ interface.h	2 Oct 2002 13:16:14 -0000	1.27
@@ -197,6 +197,7 @@
 extern char * gstrdup( char * str );
 extern int    gstrcmp( char * a,char * b );
 extern void   gfree( void ** p );
+extern void   gaddlist( char *** list,char * entry );
 
 #define guiSetFilename( s,n ) { gfree( (void **)&s ); s=gstrdup( n ); }
 




More information about the MPlayer-cvslog mailing list