summaryrefslogtreecommitdiffstats
path: root/player/lua/osc.lua
diff options
context:
space:
mode:
authorDave <14107758+xphoniex@users.noreply.github.com>2023-08-11 12:06:24 +0330
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2023-08-11 14:30:42 +0300
commitdfbdf7516586427083a868307a77c35bab8bc764 (patch)
tree4408a1710f6ed818aaae05784b9f5fd4ae3e0110 /player/lua/osc.lua
parentb51036cdc00c6be343abbc29336e48c560553b89 (diff)
downloadmpv-dfbdf7516586427083a868307a77c35bab8bc764.tar.bz2
mpv-dfbdf7516586427083a868307a77c35bab8bc764.tar.xz
osc: support speed-independent time-remaiing display
The new OSC config option "remaining_playtime" controls whether the time-remaining display considers speed (yes - default) or ignores it.
Diffstat (limited to 'player/lua/osc.lua')
-rw-r--r--player/lua/osc.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index e1d6fe2973..875ad2cc3e 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -42,6 +42,8 @@ local user_opts = {
-- to be shown as OSC title
tooltipborder = 1, -- border of tooltip in bottom/topbar
timetotal = false, -- display total time instead of remaining time?
+ remaining_playtime = true, -- display the remaining time in playtime or video-time mode
+ -- playtime takes speed into account, whereas video-time doesn't
timems = false, -- display timecodes with milliseconds?
tcspace = 100, -- timecode spacing (compensate font size estimation)
visibility = "auto", -- only used at init to set visibility_mode(...)
@@ -2105,10 +2107,12 @@ function osc_init()
ne.content = function ()
if (state.rightTC_trem) then
local minus = user_opts.unicodeminus and UNICODE_MINUS or "-"
+ local property = user_opts.remaining_playtime and "playtime-remaining"
+ or "time-remaining"
if state.tc_ms then
- return (minus..mp.get_property_osd("playtime-remaining/full"))
+ return (minus..mp.get_property_osd(property .. "/full"))
else
- return (minus..mp.get_property_osd("playtime-remaining"))
+ return (minus..mp.get_property_osd(property))
end
else
if state.tc_ms then