diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-02 19:43:05 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-02 19:43:05 +0000 |
commit | 7e8ff35fd2a29aef702b3a3170f7d7123e449a9a (patch) | |
tree | 8d926230f4b6d0690e95ed09a0f4210d3f685e22 /mplayer.c | |
parent | 758980965caeb6e4996654b56627a2a0e1ff652a (diff) | |
download | mpv-7e8ff35fd2a29aef702b3a3170f7d7123e449a9a.tar.bz2 mpv-7e8ff35fd2a29aef702b3a3170f7d7123e449a9a.tar.xz |
Add support for directory-specific mplayer.conf configuration file.
Patch by Christian P. Schmidt "schmidt digadd de"
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29634 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -48,6 +48,7 @@ #include "cfg-mplayer-def.h" #include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" #include "subreader.h" @@ -935,9 +936,6 @@ static void load_per_file_config (m_config_t* conf, const char *const file) sprintf (cfg, "%s.conf", file); - if (use_filedir_conf && try_load_config(conf, cfg)) - return; - name = strrchr(cfg, '/'); if (HAVE_DOS_PATHS) { char *tmp = strrchr(cfg, '\\'); @@ -952,6 +950,16 @@ static void load_per_file_config (m_config_t* conf, const char *const file) else name++; + if (use_filedir_conf) { + char dircfg[strlen(file)+14]; + strcpy(dircfg, cfg); + strcpy(dircfg + (name - cfg), "mplayer.conf"); + try_load_config(conf, dircfg); + + if (try_load_config(conf, cfg)) + return; + } + if ((confpath = get_path (name)) != NULL) { try_load_config(conf, confpath); |