[MPlayer-dev-eng] [PATCH] a bit of header cleanup

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Nov 25 19:35:59 CET 2006


Hello,
this patch tries to cleanup some crazy cases of headers including
headers which include headers that have nothing at all to do with the
original header (e.g. Gui/interface.h was included to get use_gui, but
ended up including both mplayer.h and libvo/sub.h).
Please comment.

Greetings,
Reimar Döffinger
-------------- next part --------------
diff --git a/Gui/interface.h b/Gui/interface.h
index 2720c64..4e5475a 100644
--- a/Gui/interface.h
+++ b/Gui/interface.h
@@ -4,7 +4,6 @@
 
 #include "../config.h"
 #include "mplayer/play.h"
-#include "mplayer.h"
 #include "libvo/font_load.h"
 #include "cfg.h"
 
@@ -142,6 +141,8 @@ extern guiInterface_t guiIntfStruct;
 #define guiFilenames	4
 #define guiALL		0xffffffff
 
+extern int use_gui;
+
 extern char *get_path(const char *filename); 
 
 extern void guiInit( void );
diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c
index 17801ed..20ad30f 100644
--- a/Gui/mplayer/gtk/fs.c
+++ b/Gui/mplayer/gtk/fs.c
@@ -7,6 +7,7 @@
 #include <unistd.h>
 
 #include "../mplayer.h"
+#include "../../mplayer.h"
 
 #include "mplayer/pixmaps/up.xpm"
 #include "mplayer/pixmaps/dir.xpm"
diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c
index f7909be..6b9acf4 100644
--- a/Gui/mplayer/gtk/opts.c
+++ b/Gui/mplayer/gtk/opts.c
@@ -12,6 +12,7 @@
 #include "../../mixer.h"
 #include "../../libao2/audio_out.h"
 #include "../../libvo/video_out.h"
+#include "../../mplayer.h"
 
 #include "../app.h"
 #include "../cfg.h"
diff --git a/libvo/sub.h b/libvo/sub.h
index d9e295b..692d2ed 100644
--- a/libvo/sub.h
+++ b/libvo/sub.h
@@ -59,6 +59,9 @@ static inline void vo_draw_text_osd(int
 
 #include "subreader.h"
 
+extern sub_data* subdata; //currently used subtitles  
+extern subtitle* vo_sub;
+
 extern unsigned char* vo_osd_text;
 
 extern int vo_osd_progbar_type;
diff --git a/mencoder.c b/mencoder.c
index c993c60..5aebd64 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -199,7 +199,7 @@ int   sub_auto = 0;
 int   subcc_enabled=0;
 int   suboverlap_enabled = 1;
 
-static sub_data* subdata=NULL;
+sub_data* subdata=NULL;
 float sub_last_pts = -303;
 
 int auto_expand=1;
diff --git a/mplayer.h b/mplayer.h
index 1b1a462..b0ff0aa 100644
--- a/mplayer.h
+++ b/mplayer.h
@@ -2,10 +2,6 @@
 #ifndef __MPLAYER_MAIN
 #define __MPLAYER_MAIN
 
-#include "libvo/sub.h"
-#include "subreader.h"
-
-extern int use_gui;
 extern char* current_module;
 
 extern char * dvd_device;
@@ -34,8 +30,6 @@ extern int    sub_auto;
 extern int    sub_pos;
 extern int    sub_unicode;
 extern char * sub_cp;
-extern sub_data* subdata; //currently used subtitles  
-extern subtitle* vo_sub;
 extern int    suboverlap_enabled;
 
 extern char * filename;


More information about the MPlayer-dev-eng mailing list