Index: mplayer.c =================================================================== --- mplayer.c (revision 29604) +++ mplayer.c (working copy) @@ -48,6 +48,7 @@ #include "cfg-mplayer-def.h" #include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" #include "subreader.h" @@ -931,13 +932,11 @@ { char *confpath; char cfg[strlen(file)+10]; + char dircfg[strlen(file)+14]; char *name; 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 +951,15 @@ else name++; + if (use_filedir_conf) { + av_strlcpy(dircfg, cfg, name-cfg+1); + strcat(dircfg, "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);