diff options
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -27,6 +27,8 @@ #include "config.h" #include "talloc.h" +#include "osdep/io.h" + #if defined(__MINGW32__) || defined(__CYGWIN__) #include <windows.h> #endif @@ -875,11 +877,7 @@ static void parse_cfgfiles(struct MPContext *mpctx, m_config_t *conf) if ((conffile = get_path("")) == NULL) mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Cannot find HOME directory.\n"); else { -#ifdef __MINGW32__ - mkdir(conffile); -#else mkdir(conffile, 0777); -#endif free(conffile); if ((conffile = get_path("config")) == NULL) mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "get_path(\"config\") problem\n"); @@ -968,8 +966,7 @@ static void load_per_output_config(m_config_t *conf, char *cfg, char *out) */ static int try_load_config(m_config_t *conf, const char *file) { - struct stat st; - if (stat(file, &st)) + if (!mp_path_exists(file)) return 0; mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Loading config '%s'\n", file); m_config_parse_config_file(conf, file); @@ -979,10 +976,10 @@ static int try_load_config(m_config_t *conf, const char *file) static void load_per_file_config(m_config_t *conf, const char * const file) { char *confpath; - char cfg[PATH_MAX]; + char cfg[MP_PATH_MAX]; const char *name; - if (strlen(file) > PATH_MAX - 14) { + if (strlen(file) > MP_PATH_MAX - 14) { mp_msg(MSGT_CPLAYER, MSGL_WARN, "Filename is too long, " "can not load file or directory specific config files\n"); return; @@ -991,7 +988,7 @@ static void load_per_file_config(m_config_t *conf, const char * const file) name = mp_basename(cfg); if (use_filedir_conf) { - char dircfg[PATH_MAX]; + char dircfg[MP_PATH_MAX]; strcpy(dircfg, cfg); strcpy(dircfg + (name - cfg), "mplayer.conf"); try_load_config(conf, dircfg); @@ -3974,6 +3971,10 @@ int main(int argc, char *argv[]) || !strcmp(argv[1], "--leak-report"))) talloc_enable_leak_report(); +#ifdef __MINGW32__ + mp_get_converted_argv(&argc, &argv); +#endif + char *mem_ptr; // movie info: |