[MPlayer-dev-eng] latest mingw network patch

Arpi arpi at thot.banki.hu
Mon Jun 9 13:36:53 CEST 2003


Hi,

> Hi,
> 
> > and here's the patch that replaces all the DATADIRs with MP_DATADIR.
> > i don't think I missed any ;-) but maybe i replaced more than
> > necessary? oh, and i removed those #undef DATADIRs that were already
> > there, too.
> 
> >  <pre>
> > -    $(DATADIR)/Skin/
> > +    $(MP_DATADIR)/Skin/
> 
> upsz
> is it really required to change shell environment variabne too?
> DATADIR is quite standard in gnu configure world...

what about this:

-----------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.721
diff -u -r1.721 configure
--- configure	9 Jun 2003 10:44:34 -0000	1.721
+++ configure	9 Jun 2003 11:35:09 -0000
@@ -5415,9 +5415,9 @@
 $_def_stddef
 
 /* Common data directory (for fonts, etc) */
-#define DATADIR "$_datadir"
-#define CONFDIR "$_confdir"
-#define LIBDIR "$_libdir"
+#define MPLAYER_DATADIR "$_datadir"
+#define MPLAYER_CONFDIR "$_confdir"
+#define MPLAYER_LIBDIR "$_libdir"
 
 /* Define this to compile stream-caching support, it can be enabled via
    -cache <kilobytes> */
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.214
diff -u -r1.214 mencoder.c
--- mencoder.c	23 May 2003 15:01:02 -0000	1.214
+++ mencoder.c	9 Jun 2003 11:35:10 -0000
@@ -377,7 +377,7 @@
 
 // check codec.conf
 if(!parse_codec_cfg(get_path("codecs.conf"))){
-  if(!parse_codec_cfg(CONFDIR"/codecs.conf")){
+  if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
     if(!parse_codec_cfg(NULL)){
       mp_msg(MSGT_MENCODER,MSGL_HINT,MSGTR_CopyCodecsConf);
       exit(0);
@@ -443,7 +443,7 @@
       // try default:
        vo_font=read_font_desc(get_path("font/font.desc"),font_factor,verbose>1);
        if(!vo_font)
-       vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1);
+       vo_font=read_font_desc(MPLAYER_DATADIR "/font/font.desc",font_factor,verbose>1);
   }
 #endif
 #endif
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.702
diff -u -r1.702 mplayer.c
--- mplayer.c	2 Jun 2003 18:19:21 -0000	1.702
+++ mplayer.c	9 Jun 2003 11:35:11 -0000
@@ -525,7 +525,7 @@
 {
 char *conffile;
 int conffile_fd;
-if (m_config_parse_config_file(conf, CONFDIR"/mplayer.conf") < 0)
+if (m_config_parse_config_file(conf, MPLAYER_CONFDIR "/mplayer.conf") < 0)
   exit(1);
 if ((conffile = get_path("")) == NULL) {
   mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoHomeDir);
@@ -866,7 +866,7 @@
 
 // check codec.conf
 if(!parse_codec_cfg(get_path("codecs.conf"))){
-  if(!parse_codec_cfg(CONFDIR"/codecs.conf")){
+  if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
     if(!parse_codec_cfg(NULL)){
       mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf);
       exit(0);
@@ -1038,7 +1038,7 @@
       // try default:
        vo_font=read_font_desc(get_path("font/font.desc"),font_factor,verbose>1);
        if(!vo_font)
-       vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1);
+       vo_font=read_font_desc(MPLAYER_DATADIR "/font/font.desc",font_factor,verbose>1);
   }
 #ifdef HAVE_FREETYPE
   if (!vo_font)
@@ -1117,8 +1117,8 @@
      if(menu_init(menu_cfg))
        mp_msg(MSGT_CPLAYER,MSGL_INFO,"Menu inited: %s\n", menu_cfg);
      else {
-       if(menu_init(CONFDIR"/menu.conf"))
-         mp_msg(MSGT_CPLAYER,MSGL_INFO,"Menu inited: %s\n", CONFDIR"/menu.conf");
+       if(menu_init(MPLAYER_CONFDIR "/menu.conf"))
+         mp_msg(MSGT_CPLAYER,MSGL_INFO,"Menu inited: %s\n", MPLAYER_CONFDIR"/menu.conf");
        else {
          mp_msg(MSGT_CPLAYER,MSGL_INFO,"Menu init failed\n");
          use_menu = 0;
Index: Gui/interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.85
diff -u -r1.85 interface.c
--- Gui/interface.c	26 May 2003 08:33:43 -0000	1.85
+++ Gui/interface.c	9 Jun 2003 11:35:12 -0000
@@ -188,7 +188,7 @@
  wsXInit( (void *)mDisplay );
 // --- load skin
  skinDirInHome=get_path("Skin");
- skinMPlayerDir=DATADIR "/Skin";
+ skinMPlayerDir=MPLAYER_DATADIR "/Skin";
  printf("SKIN dir 1: '%s'\n",skinDirInHome);
  printf("SKIN dir 2: '%s'\n",skinMPlayerDir);
  if ( !skinName ) skinName=strdup( "default" );
@@ -405,7 +405,7 @@
     vo_font=read_font_desc( font_name,font_factor,0 );
     if ( !vo_font )
      {
-      gfree( (void **)&font_name ); font_name=gstrdup( DATADIR"/font/font.desc" );
+      gfree( (void **)&font_name ); font_name=gstrdup(MPLAYER_DATADIR "/font/font.desc" );
       vo_font=read_font_desc( font_name,font_factor,0 );
      }
    }
Index: input/input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.74
diff -u -r1.74 input.c
--- input/input.c	30 May 2003 18:23:55 -0000	1.74
+++ input/input.c	9 Jun 2003 11:35:13 -0000
@@ -1464,7 +1464,7 @@
   
   if(! mp_input_parse_config(file)) {
     // Try global conf dir
-    file = CONFDIR"/input.conf";
+    file = MPLAYER_CONFDIR "/input.conf";
     if(! mp_input_parse_config(file))
       mp_msg(MSGT_INPUT,MSGL_WARN,"Falling back on default (hardcoded) input config\n");
   }
Index: libmpcodecs/dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.c,v
retrieving revision 1.24
diff -u -r1.24 dec_audio.c
--- libmpcodecs/dec_audio.c	28 Jan 2003 00:59:34 -0000	1.24
+++ libmpcodecs/dec_audio.c	9 Jun 2003 11:35:13 -0000
@@ -160,11 +160,11 @@
 	    ad_functions_t *funcs_sym;
 	    ad_info_t *info_sym;
 	    
-	    buf_len = strlen(LIBDIR)+strlen(sh_audio->codec->drv)+16;
+	    buf_len = strlen(MPLAYER_LIBDIR)+strlen(sh_audio->codec->drv)+16;
 	    buf = malloc(buf_len);
 	    if (!buf)
 		break;
-	    snprintf(buf, buf_len, "%s/mplayer/ad_%s.so", LIBDIR, sh_audio->codec->drv);
+	    snprintf(buf, buf_len, "%s/mplayer/ad_%s.so", MPLAYER_LIBDIR, sh_audio->codec->drv);
 	    mp_msg(MSGT_DECAUDIO, MSGL_DBG2, "Trying to open external plugin: %s\n", buf);
 	    sh_audio->dec_handle = dlopen(buf, RTLD_LAZY);
 	    if (!sh_audio->dec_handle)
@@ -181,7 +181,7 @@
 	    free(buf);
 	    mpadec = funcs_sym;
 	    mp_msg(MSGT_DECAUDIO, MSGL_V, "Using external decoder plugin (%s/mplayer/ad_%s.so)!\n",
-		LIBDIR, sh_audio->codec->drv);
+		MPLAYER_LIBDIR, sh_audio->codec->drv);
 	}
 #endif
 	if(!mpadec){ // driver not available (==compiled in)
Index: libmpcodecs/dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.157
diff -u -r1.157 dec_video.c
--- libmpcodecs/dec_video.c	14 Feb 2003 21:45:44 -0000	1.157
+++ libmpcodecs/dec_video.c	9 Jun 2003 11:35:13 -0000
@@ -187,11 +187,11 @@
 	    vd_functions_t *funcs_sym;
 	    vd_info_t *info_sym;
 
-	    buf_len = strlen(LIBDIR)+strlen(sh_video->codec->drv)+16;
+	    buf_len = strlen(MPLAYER_LIBDIR)+strlen(sh_video->codec->drv)+16;
 	    buf = malloc(buf_len);
 	    if (!buf)
 		break;
-	    snprintf(buf, buf_len, "%s/mplayer/vd_%s.so", LIBDIR, sh_video->codec->drv);
+	    snprintf(buf, buf_len, "%s/mplayer/vd_%s.so", MPLAYER_LIBDIR, sh_video->codec->drv);
 	    mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Trying to open external plugin: %s\n", buf);
 	    sh_video->dec_handle = dlopen(buf, RTLD_LAZY);
 	    if (!sh_video->dec_handle)
@@ -207,7 +207,7 @@
 	    free(buf);
 	    mpvdec = funcs_sym;
 	    mp_msg(MSGT_DECVIDEO, MSGL_V, "Using external decoder plugin (%s/mplayer/vd_%s.so)!\n",
-		LIBDIR, sh_video->codec->drv);
+		MPLAYER_LIBDIR, sh_video->codec->drv);
 	}
 #endif
 	if(!mpvdec){ // driver not available (==compiled in)
Index: libmpdemux/cache2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cache2.c,v
retrieving revision 1.23
diff -u -r1.23 cache2.c
--- libmpdemux/cache2.c	3 Jun 2003 17:43:49 -0000	1.23
+++ libmpdemux/cache2.c	9 Jun 2003 11:35:13 -0000
@@ -22,7 +22,6 @@
 #include <sys/wait.h>
 #include "../osdep/shmem.h"
 #else
-#undef DATADIR
 #include <windows.h>
 static DWORD WINAPI ThreadProc(void* s);
 #endif
Index: libmpdvdkit2/ioctl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdvdkit2/ioctl.c,v
retrieving revision 1.6
diff -u -r1.6 ioctl.c
--- libmpdvdkit2/ioctl.c	8 Feb 2003 00:22:38 -0000	1.6
+++ libmpdvdkit2/ioctl.c	9 Jun 2003 11:35:14 -0000
@@ -39,7 +39,6 @@
 #include <sys/types.h>
 
 #if defined( WIN32 )
-#   undef DATADIR /* clashes with /usr/include/w32api/objidl.h */
 #   include <windows.h>
 #   include <winioctl.h>
 #elif defined ( SYS_OS2 )
Index: libvo/font_load.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.c,v
retrieving revision 1.25
diff -u -r1.25 font_load.c
--- libvo/font_load.c	29 Dec 2002 14:59:23 -0000	1.25
+++ libvo/font_load.c	9 Jun 2003 11:35:14 -0000
@@ -157,7 +157,7 @@
   } else    
 
   if(strcmp(section,"[files]")==0){
-      char *default_dir=DATADIR"/font";
+      char *default_dir=MPLAYER_DATADIR "/font";
       if(pdb==2 && strcmp(p[0],"alpha")==0){
     	  char *cp;
 	  if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) return NULL;
Index: libvo/font_load_ft.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load_ft.c,v
retrieving revision 1.9
diff -u -r1.9 font_load_ft.c
--- libvo/font_load_ft.c	30 Jan 2003 19:58:43 -0000	1.9
+++ libvo/font_load_ft.c	9 Jun 2003 11:35:15 -0000
@@ -905,7 +905,7 @@
     if (err) {
 	err = FT_New_Face(library, get_path("subfont.ttf"), 0, face);
 	if (err) {
-	    err = FT_New_Face(library, DATADIR"/subfont.ttf", 0, face);
+	    err = FT_New_Face(library, MPLAYER_DATADIR "/subfont.ttf", 0, face);
 	    if (err) {
 	        mp_msg(MSGT_OSD, MSGL_ERR, "New_Face failed. Maybe the font path is wrong.\nPlease supply the text font file (~/.mplayer/subfont.ttf).\n" );
 		return -1;
Index: libvo/vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.57
diff -u -r1.57 vosub_vidix.c
--- libvo/vosub_vidix.c	15 Dec 2002 18:18:41 -0000	1.57
+++ libvo/vosub_vidix.c	9 Jun 2003 11:35:15 -0000
@@ -709,7 +709,7 @@
 	  printf("vosub_vidix: You have wrong version of VIDIX library\n");
 	  return -1;
 	}
-	vidix_handler = vdlOpen(LIBDIR"/mplayer/vidix/",
+	vidix_handler = vdlOpen(MPLAYER_LIBDIR "/mplayer/vidix/",
 				drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL,
 				TYPE_OUTPUT,
 				verbose);
Index: osdep/glob-win.c
===================================================================
RCS file: /cvsroot/mplayer/main/osdep/glob-win.c,v
retrieving revision 1.1
diff -u -r1.1 glob-win.c
--- osdep/glob-win.c	25 Apr 2003 10:00:18 -0000	1.1
+++ osdep/glob-win.c	9 Jun 2003 11:35:15 -0000
@@ -5,7 +5,6 @@
 
 #ifndef HAVE_GLOB
 #ifdef __MINGW32__
-#undef DATADIR
 #include <windows.h>
 #include "glob.h"
 
-----------------

A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list