Index: mplayer.c =================================================================== --- mplayer.c (revision 28348) +++ mplayer.c (working copy) @@ -362,6 +362,7 @@ short edl_decision = 0; ///< 1 when an EDL operation has been made. FILE* edl_fd = NULL; ///< fd to write to when in -edlout mode. int use_filedir_conf; +int use_dir_conf; static unsigned int initialized_flags=0; #include "mpcommon.h" @@ -964,6 +965,21 @@ } } +static void load_per_dir_config (m_config_t* conf, const char *const file) +{ + char cfg[13]; + struct stat st; + + sprintf (cfg, "mplayer.conf", file); + + if (use_dir_conf && !stat (cfg, &st)) + { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LoadingConfig, cfg); + m_config_parse_config_file (conf, cfg); + return; + } +} + /* When libmpdemux performs a blocking operation (network connection or * cache filling) if the operation fails we use this function to check * if it was interrupted by the user. @@ -2942,6 +2958,7 @@ load_per_protocol_config (mconfig, filename); load_per_extension_config (mconfig, filename); load_per_file_config (mconfig, filename); + load_per_dir_config (mconfig, filename); } if (video_driver_list) Index: cfg-mplayer.h =================================================================== --- cfg-mplayer.h (revision 28348) +++ cfg-mplayer.h (working copy) @@ -246,6 +246,8 @@ {"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nouse-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"use-dir-conf", &use_dir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nouse-dir-conf", &use_dir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #ifdef CONFIG_CRASH_DEBUG {"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},