Index: mplayer.c =================================================================== --- mplayer.c (revision 29565) +++ mplayer.c (working copy) @@ -48,6 +48,7 @@ #include "cfg-mplayer-def.h" #include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" #include "subreader.h" @@ -916,10 +917,26 @@ static void load_per_file_config (m_config_t* conf, const char *const file) { char *confpath; - char cfg[strlen(file)+10]; + char cfg[strlen(file)+14]; struct stat st; char *name; + if (use_filedir_conf) + { + if ((name = strrchr (file, '/')) == NULL) + { + cfg[0] = 0; + } else { + av_strlcpy (cfg, file, name - file + 2); + } + strcat (cfg, "mplayer.conf"); + if (!stat (cfg, &st)) + { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LoadingConfig, cfg); + m_config_parse_config_file (conf, cfg); + } + } + sprintf (cfg, "%s.conf", file); if (use_filedir_conf && !stat (cfg, &st))