diff options
author | Julian <MyFakeAcc.4@googlemail.com> | 2016-06-26 01:41:53 +0900 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-10-09 20:40:31 +0200 |
commit | 2de778f699a68282fbb8191f71059f9192e85689 (patch) | |
tree | a64c3d4c32c8b0ca567c2836c6233e5fda47aabc /player | |
parent | fcacf8286561ccd4a30f77401ef47c3c53191d5b (diff) | |
download | mpv-2de778f699a68282fbb8191f71059f9192e85689.tar.bz2 mpv-2de778f699a68282fbb8191f71059f9192e85689.tar.xz |
stats: update stats when file changes
Only in toggled mode and actually only when the video output is
reconfigured. This should cover the relevant cases.
Fixes #22
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/stats.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 91eab5ffa9..c2d22b80e3 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -305,8 +305,14 @@ end mp.add_key_binding(o.key_oneshot, "display_stats", print_stats, {repeatable=true}) if pcall(function() timer:is_enabled() end) then mp.add_key_binding(o.key_toggle, "display_stats_toggle", toggle_stats, {repeatable=false}) + mp.register_event("video-reconfig", + function() + if timer:is_enabled() then + print_stats(o.redraw_delay + 1) + end + end) else local txt = "Please upgrade mpv to toggle stats" mp.add_key_binding(o.key_toggle, "display_stats_toggle", - function() print(txt) ; mp.osd_message(txt) end, {repeatable=false}) + function() print(txt) ; mp.osd_message(txt) end, {repeatable=false}) end |