diff options
Diffstat (limited to 'player/configfiles.c')
-rw-r--r-- | player/configfiles.c | 79 |
1 files changed, 44 insertions, 35 deletions
diff --git a/player/configfiles.c b/player/configfiles.c index 7356a9a81b..d87f83c1f7 100644 --- a/player/configfiles.c +++ b/player/configfiles.c @@ -92,7 +92,8 @@ static int try_load_config(struct MPContext *mpctx, const char *file, int flags) // Set options file-local, and don't set them if the user set them via the // command line. -#define FILE_LOCAL_FLAGS (M_SETOPT_BACKUP | M_SETOPT_PRESERVE_CMDLINE) +#define FILE_LOCAL_FLAGS \ + (M_SETOPT_BACKUP | M_SETOPT_RUNTIME | M_SETOPT_PRESERVE_CMDLINE) static void mp_load_per_file_config(struct MPContext *mpctx) { @@ -137,6 +138,8 @@ static void mp_auto_load_profile(struct MPContext *mpctx, char *category, m_profile_t *p = m_config_get_profile0(mpctx->mconfig, t); if (p) { MP_INFO(mpctx, "Auto-loading profile '%s'\n", t); + if (strcmp(category, "ao") == 0 || strcmp(category, "vo") == 0) + MP_WARN(mpctx, "'%s' auto profiles are deprecated.\n", category); m_config_set_profile(mpctx->mconfig, t, FILE_LOCAL_FLAGS); } } @@ -152,8 +155,8 @@ void mp_load_auto_profiles(struct MPContext *mpctx) mp_load_per_file_config(mpctx); - if (opts->vo.video_driver_list) - mp_auto_load_profile(mpctx, "vo", bstr0(opts->vo.video_driver_list[0].name)); + if (opts->vo->video_driver_list) + mp_auto_load_profile(mpctx, "vo", bstr0(opts->vo->video_driver_list[0].name)); if (opts->audio_driver_list) mp_auto_load_profile(mpctx, "ao", bstr0(opts->audio_driver_list[0].name)); } @@ -178,8 +181,8 @@ static char *mp_get_playback_resume_config_filename(struct MPContext *mpctx, realpath = mp_path_join(tmp, cwd, fname); } } - if (bstr_startswith0(bfname, "dvd://") && opts->dvd_device) - realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->dvd_device); + if (bstr_startswith0(bfname, "dvd://") && opts->dvd_opts->device) + realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->dvd_opts->device); if ((bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") || bstr_startswith0(bfname, "bluray://")) && opts->bluray_device) realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->bluray_device); @@ -190,6 +193,14 @@ static char *mp_get_playback_resume_config_filename(struct MPContext *mpctx, conf = talloc_asprintf_append(conf, "%02X", md5[i]); if (!mpctx->cached_watch_later_configdir) { + char *wl_dir = mpctx->opts->watch_later_directory; + if (wl_dir && wl_dir[0]) { + mpctx->cached_watch_later_configdir = + mp_get_user_path(mpctx, mpctx->global, wl_dir); + } + } + + if (!mpctx->cached_watch_later_configdir) { mpctx->cached_watch_later_configdir = mp_find_user_config_file(mpctx, mpctx->global, MP_WATCH_LATER_CONF); } @@ -203,43 +214,41 @@ exit: } static const char *const backup_properties[] = { - "options/osd-level", + "osd-level", //"loop", - "options/speed", + "speed", "options/edition", - "options/pause", + "pause", "volume", "mute", - "options/audio-delay", + "audio-delay", //"balance", - "options/fullscreen", - "options/colormatrix", - "options/colormatrix-input-range", - "options/colormatrix-output-range", - "options/ontop", - "options/border", - "options/gamma", - "options/brightness", - "options/contrast", - "options/saturation", - "options/hue", + "fullscreen", + "ontop", + "border", + "gamma", + "brightness", + "contrast", + "saturation", + "hue", "options/deinterlace", - "options/vf", - "options/af", - "options/panscan", + "vf", + "af", + "panscan", "options/aid", "options/vid", "options/sid", - "options/sub-delay", - "options/sub-pos", - "options/sub-visibility", - "options/sub-scale", - "options/sub-use-margins", - "options/ass-force-margins", - "options/ass-vsfilter-aspect-compat", - "options/ass-style-override", - "options/ab-loop-a", - "options/ab-loop-b", + "sub-delay", + "sub-speed", + "sub-pos", + "sub-visibility", + "sub-scale", + "sub-use-margins", + "sub-ass-force-margins", + "sub-ass-vsfilter-aspect-compat", + "sub-ass-style-override", + "ab-loop-a", + "ab-loop-b", "options/video-aspect", 0 }; @@ -311,12 +320,12 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) goto exit; } - mp_mk_config_dir(mpctx->global, MP_WATCH_LATER_CONF); - conffile = mp_get_playback_resume_config_filename(mpctx, cur->filename); if (!conffile) goto exit; + mp_mk_config_dir(mpctx->global, mpctx->cached_watch_later_configdir); + MP_INFO(mpctx, "Saving state.\n"); FILE *file = fopen(conffile, "wb"); |