]> git.sesse.net Git - ultimatescore/blobdiff - nageru/ultimate.lua
Realign the clock bug.
[ultimatescore] / nageru / ultimate.lua
index 844a89c5ebd4e0d1c388b747d4c026b3822d9b32..776a7d1b3b53612cd2ca3b79693d0e9c2f873fe2 100644 (file)
@@ -51,7 +51,7 @@ local cef_path = Nageru.THEME_PATH:match("(.*)/nageru/")
 local cef_input = HTMLInput.new("file://" .. cef_path .. "/score.html")
 cef_input:execute_javascript_async("play()")
 
-local bg_video = VideoInput.new(cef_path .. "/flow-720.mp4", Nageru.VIDEO_FORMAT_YCBCR)
+local bg_video = VideoInput.new(cef_path .. "/flow-1080.mp4", Nageru.VIDEO_FORMAT_YCBCR)
 
 function reload_cef()
        cef_input:reload()
@@ -103,7 +103,7 @@ function make_fade_input(chain, signal, live, deint, scale)
                input:connect_signal(signal)
                last = input
        else
-               input = chain:add_effect(ImageInput.new(cef_path .. "/nageru/dsn-bg.png"))
+               input = chain:add_effect(ImageInput.new(cef_path .. "/nageru/dsn-bg-1080.png"))
                last = input
        end
 
@@ -292,7 +292,7 @@ local simple_chains = make_cartesian_product({
        return make_simple_chain(input_deint, input_scale, has_overlay, hq)
 end)
 
--- A chain to show a single static picture on screen. Never with CasparCG overlay.
+-- A chain to show a single static picture on screen. Never with HTML overlay.
 local static_chains = make_cartesian_product({
        {true, false}            -- hq
 }, function(hq)
@@ -693,6 +693,8 @@ function get_sbs_chain(signals, t, width, height, input_resolution)
        return sbs_chains[input0_type][overlay_enabled][input1_type][true]
 end
 
+local last_rate = 0.0
+
 -- API ENTRY POINT
 -- Called every frame. Get the chain for displaying at input <num>,
 -- where 0 is live, 1 is preview, 2 is the first channel to display
@@ -746,12 +748,18 @@ function get_chain(num, t, width, height, signals)
        last_resolution = input_resolution
 
        -- Save some CPU time if we're not having SBS on live.
+       local new_rate
        if live_signal_num == SBS_SIGNAL_NUM or
           preview_signal_num == SBS_SIGNAL_NUM or
           transition_type == ZOOM_TRANSITION then
-               bg_video:change_rate(1.0)
+               new_rate = 1.0
        else
-               bg_video:change_rate(0.0001)
+               new_rate = 0.0001
+       end
+       if new_rate ~= last_rate then
+               -- Avoid waking up the video thread (which may be sleeping) if the rate is the same.
+               bg_video:change_rate(new_rate)
+               last_rate = new_rate
        end
 
        if num == 0 then  -- Live.