diff options
author | Niklas Haas <git@haasn.dev> | 2023-08-30 15:09:51 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2023-08-30 17:10:13 +0200 |
commit | 7f9b1b32a5ee5419f0f467cfa68833f7ad186e43 (patch) | |
tree | 59f44bc35e7268674a651cba86be51f18d6d8b01 /player/lua/stats.lua | |
parent | 67d31a8266893eafd0e823c59da673ac718be36f (diff) | |
download | mpv-7f9b1b32a5ee5419f0f467cfa68833f7ad186e43.tar.bz2 mpv-7f9b1b32a5ee5419f0f467cfa68833f7ad186e43.tar.xz |
stats.lua: enable --tone-mapping-visualize while stats shown
Except in oneshot mode. Controllable via new option.
Diffstat (limited to 'player/lua/stats.lua')
-rw-r--r-- | player/lua/stats.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua index a003b1af0c..acb67abfe0 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -35,6 +35,7 @@ local o = { plot_perfdata = true, plot_vsync_ratio = true, plot_vsync_jitter = true, + plot_tonemapping_lut = true, -- also enable tone-mapping-visualize skip_frames = 5, global_max = true, flush_graph_data = true, -- clear data buffers when toggling @@ -95,6 +96,7 @@ local cache_recorder_timer = nil local curr_page = o.key_page_1 local pages = {} local scroll_bound = false +local tm_viz_prev = nil -- Save these sequences locally as we'll need them a lot local ass_start = mp.get_property_osd("osd-ass-cc/0") local ass_stop = mp.get_property_osd("osd-ass-cc/1") @@ -1209,6 +1211,10 @@ local function process_key_binding(oneshot) elseif not display_timer.oneshot and not oneshot then display_timer:kill() cache_recorder_timer:stop() + if tm_viz_prev ~= nil then + mp.set_property_native("tone-mapping-visualize", tm_viz_prev) + tm_viz_prev = nil + end clear_screen() remove_page_bindings() if recorder then @@ -1226,6 +1232,10 @@ local function process_key_binding(oneshot) -- changes, but it's fine for an internal script. mp.observe_property("vsync-jitter", "none", recorder) end + if not oneshot and o.plot_tonemapping_lut then + tm_viz_prev = mp.get_property_native("tone-mapping-visualize") + mp.set_property_native("tone-mapping-visualize", true) + end if not oneshot then cache_ahead_buf = {0, pos = 1, len = 50, max = 0} cache_speed_buf = {0, pos = 1, len = 50, max = 0} |