diff options
author | Guido Cella <guido@guidocella.xyz> | 2021-07-21 11:06:41 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-07-21 13:19:28 +0000 |
commit | 1d1d1fbff9648e9adf7acf571514abf618ffc40f (patch) | |
tree | 9a3fde28a5fe5e2f5465fe7b7fdecddc24a03b4c /options/m_config_frontend.h | |
parent | ccb87ad6374c69beb7e88357003bb13cb427a6ee (diff) | |
download | mpv-1d1d1fbff9648e9adf7acf571514abf618ffc40f.tar.bz2 mpv-1d1d1fbff9648e9adf7acf571514abf618ffc40f.tar.xz |
options: add watch-later-options
This allows configuring which options are saved by quit-watch-later.
Fixes #4126, #4641 and #5567.
Toggling a video or audio filter twice would treat the option as changed
because the backup value is NULL, and the current value of vf/af is a
list with one empty item, so obj_settings_list_equal had to be changed.
Diffstat (limited to 'options/m_config_frontend.h')
-rw-r--r-- | options/m_config_frontend.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/options/m_config_frontend.h b/options/m_config_frontend.h index ee6b9aec46..2812033b75 100644 --- a/options/m_config_frontend.h +++ b/options/m_config_frontend.h @@ -75,6 +75,7 @@ typedef struct m_config { int profile_backup_flags; struct m_opt_backup *backup_opts; + struct m_opt_backup *watch_later_backup_opts; bool use_profiles; bool is_toplevel; @@ -134,10 +135,18 @@ void m_config_backup_opt(struct m_config *config, const char *opt); // Call m_config_backup_opt() on all options. void m_config_backup_all_opts(struct m_config *config); +// Backup options on startup so that quit-watch-later can compare the current +// values to their backups, and save them only if they have been changed. +void m_config_backup_watch_later_opts(struct m_config *config); + // Restore all options backed up with m_config_backup_opt(), and delete the // backups afterwards. void m_config_restore_backups(struct m_config *config); +// Whether opt_name is different from its initial value. +bool m_config_watch_later_backup_opt_changed(struct m_config *config, + char *opt_name); + enum { M_SETOPT_PRE_PARSE_ONLY = 1, // Silently ignore non-M_OPT_PRE_PARSE opt. M_SETOPT_CHECK_ONLY = 2, // Don't set, just check name/value |