[MPlayer-dev-eng] Tiny patch to make ~/.mplayer overridable

Nikolai Weibull nikolai.weibull at gmail.com
Fri Oct 14 15:03:11 CEST 2005


Hi!

I would like to be able to override the default of ~/.mplayer as the
configuration directory of mplayer in get_path.c.  The following patch allows
the user to set the $MPLAYER_HOME environment variable to point to the location
were they want mplayer to store its configuration stuff.  (Sorry that I had to
inline it, but I'm posting through gmane as mplayerhq.hu is down.)

Index: get_path.c
===================================================================
RCS file: /cvsroot/mplayer/main/get_path.c,v
retrieving revision 1.10
diff -u -r1.10 get_path.c
--- get_path.c  3 Jun 2005 14:52:15 -0000       1.10
+++ get_path.c  14 Oct 2005 12:58:37 -0000
@@ -36,7 +36,9 @@
        char *bdl_url_path = NULL;
 #endif

-       if ((homedir = getenv("HOME")) == NULL)
+        if ((homedir = getenv("MPLAYER_HOME")) != NULL)
+                config_dir = "";
+        else if ((homedir = getenv("HOME")) == NULL)
 #if defined(__MINGW32__)||defined(__CYGWIN__) /*hack to get fonts etc. loaded
outside of cygwin environment*/
        {
         int i,imax=0;





More information about the MPlayer-dev-eng mailing list