[MPlayer-dev-eng] [PATCH] OSS ifdef cleanup

Filip Kalinski filon at pld.org.pl
Fri Dec 27 23:42:39 CET 2002


Hi,

Lots of functions and variables specific to OSS audio are used without
ifdefs, so it is not possible to compile mplayer without enabling it,
alse some are already ifdefed, so it is a mess.

This patch fixes it.

-- 
Filip Kalinski <filon at pld.org.pl>
-------------- next part --------------
diff -urN main/Gui/cfg.c main.test/Gui/cfg.c
--- main/Gui/cfg.c	2002-12-02 21:02:11.000000000 +0100
+++ main.test/Gui/cfg.c	2002-12-27 10:30:05.000000000 +0100
@@ -36,8 +36,10 @@
 int    gtkAOSurround = 0;
 int    gtkAOExtraStereo = 0;
 float  gtkAOExtraStereoMul = 1.0;
+#ifdef USE_OSS_AUDIO
 char * gtkAOOSSMixer;
 char * gtkAOOSSDevice;
+#endif
 
 int    gtkCacheOn = 0;
 int    gtkCacheSize = 2048;
@@ -96,8 +98,10 @@
  { "ao_surround",&gtkAOSurround,CONF_TYPE_FLAG,0,0,1,NULL },
  { "ao_extra_stereo",&gtkAOExtraStereo,CONF_TYPE_FLAG,0,0,1,NULL },
  { "ao_extra_stereo_coefficient",&gtkAOExtraStereoMul,CONF_TYPE_FLOAT,CONF_RANGE,-10,10,NULL },
+#ifdef USE_OSS_AUDIO
  { "ao_oss_mixer",&gtkAOOSSMixer,CONF_TYPE_STRING,0,0,0,NULL },
  { "ao_oss_device",&gtkAOOSSDevice,CONF_TYPE_STRING,0,0,0,NULL },
+#endif
  
  { "osd_level",&osd_level,CONF_TYPE_INT,CONF_RANGE,0,2,NULL },
  { "sub_auto_load",&sub_auto,CONF_TYPE_FLAG,0,0,1,NULL },
diff -urN main/Gui/cfg.h main.test/Gui/cfg.h
--- main/Gui/cfg.h	2002-12-02 21:02:11.000000000 +0100
+++ main.test/Gui/cfg.h	2002-12-27 10:30:05.000000000 +0100
@@ -13,9 +13,13 @@
 extern int    gtkAOFakeSurround;
 extern int    gtkAOExtraStereo;
 extern float  gtkAOExtraStereoMul;
+#ifdef USE_OSS_AUDIO
 extern char * gtkAOOSSMixer;
 extern char * gtkAOOSSDevice;
+#endif
+#ifdef HAVE_DXR3
 extern char * gtkDXR3Device;
+#endif
 
 extern int    gtkCacheOn;
 extern int    gtkCacheSize;
diff -urN main/Gui/interface.c main.test/Gui/interface.c
--- main/Gui/interface.c	2002-12-19 17:28:00.000000000 +0100
+++ main.test/Gui/interface.c	2002-12-27 10:30:05.000000000 +0100
@@ -163,8 +163,10 @@
  guiIntfStruct.StreamType=-1;
 
  memset( &gtkEquChannels,0,sizeof( gtkEquChannels ) );
+#ifdef USE_OSS_AUDIO
  if ( !gtkAOOSSMixer ) gtkAOOSSMixer=strdup( PATH_DEV_MIXER );
  if ( !gtkAOOSSDevice ) gtkAOOSSDevice=strdup( PATH_DEV_DSP );
+#endif
 #ifdef HAVE_DXR3
  if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" );
 #endif
@@ -691,6 +693,7 @@
 	  gset( &ao_plugin_cfg.plugin_list,"extrastereo" );
 	  ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul;
 	 }
+#ifdef USE_OSS_AUDIO
 	mixer_device=gstrdup( gtkAOOSSMixer );
 	if ( audio_driver_list && !gstrncmp( audio_driver_list[0],"oss",3 ) && gtkAOOSSDevice )
 	 {
diff -urN main/Gui/mplayer/gtk/opts.h main.test/Gui/mplayer/gtk/opts.h
--- main/Gui/mplayer/gtk/opts.h	2002-12-02 21:02:16.000000000 +0100
+++ main.test/Gui/mplayer/gtk/opts.h	2002-12-27 10:30:05.000000000 +0100
@@ -4,12 +4,16 @@
 
 #include <gtk/gtk.h>
 
+#ifdef USE_OSS_AUDIO
 extern GtkWidget * OSSConfig;
+#endif
 extern GtkWidget * Preferences;
 extern GtkWidget * prEFontName;
 
 extern GtkWidget * create_Preferences( void );
+#ifdef USE_OSS_AUDIO
 extern GtkWidget * create_OSSConfig( void );
+#endif
 
 extern void ShowPreferences( void );
 
diff -urN main/libmpdemux/audio_in.h main.test/libmpdemux/audio_in.h
--- main/libmpdemux/audio_in.h	2002-10-02 18:46:55.000000000 +0200
+++ main.test/libmpdemux/audio_in.h	2002-12-27 11:09:08.000000000 +0100
@@ -19,11 +19,13 @@
 } ai_alsa_t;
 #endif
 
+#ifdef USE_OSS_AUDIO
 typedef struct {
     char *device;
 
     int audio_fd;
 } ai_oss_t;
+#endif
 
 typedef struct 
 {
@@ -44,7 +46,9 @@
 #ifdef HAVE_ALSA9
     ai_alsa_t alsa;
 #endif
+#ifdef USE_OSS_AUDIO
     ai_oss_t oss;
+#endif
 } audio_in_t;
 
 int audio_in_init(audio_in_t *ai, int type);
@@ -62,8 +66,10 @@
 int ai_alsa_xrun(audio_in_t *ai);
 #endif
 
+#ifdef USE_OSS_AUDIO
 int ai_oss_set_samplerate(audio_in_t *ai);
 int ai_oss_set_channels(audio_in_t *ai);
 int ai_oss_init(audio_in_t *ai);
+#endif
 
 #endif /* _audio_in_h */


More information about the MPlayer-dev-eng mailing list