Index: mplayer.c =================================================================== --- mplayer.c (revision 29565) +++ mplayer.c (working copy) @@ -916,10 +916,27 @@ 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 { + strncpy (cfg, file, name - file + 1); + cfg[name - file + 1] = 0; + } + 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))