summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorCogentRedTester <cogent.redtester@outlook.com>2022-01-30 22:16:32 +1030
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2022-01-30 15:13:10 +0200
commit712ef65e2a830e9db082d5d36563ff0d1df0097c (patch)
tree31409fbbdf3854625bba28a4a5b8e868b1d683b0 /player/lua
parent9fd9239990815450cc19d2cfb642da62e141a3f0 (diff)
downloadmpv-712ef65e2a830e9db082d5d36563ff0d1df0097c.tar.bz2
mpv-712ef65e2a830e9db082d5d36563ff0d1df0097c.tar.xz
auto_profiles.lua: don't warn if profile-restore=default
The code assumed that the value of the profile-restore field is "default" for such profiles, but the C implementation is such that the field is intentionally omitted in such case. This resulted in incorrectly trying to restore such profiles. However, there are no stored values with profile-restore=default, so it only resulted in a harmless warning, but otherwise behaved correctly (i.e. nothing is restored). Fix the condition by taking into account that missing field means "default", so that it doesn't try to restore in such case, and avoid the warning.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/auto_profiles.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/lua/auto_profiles.lua b/player/lua/auto_profiles.lua
index fba57cc74a..f43e6b28f3 100644
--- a/player/lua/auto_profiles.lua
+++ b/player/lua/auto_profiles.lua
@@ -163,7 +163,7 @@ local function load_profiles()
properties = {},
status = nil,
dirty = true, -- need re-evaluate
- has_restore_opt = v["profile-restore"] ~= "default"
+ has_restore_opt = v["profile-restore"] and v["profile-restore"] ~= "default"
}
profiles[#profiles + 1] = profile
have_dirty_profiles = true