1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-20 10:17:31 +00:00

osc: skip rendering when osd_dimensions are 0

The idle logo could appear on the left side of the window for a split
second after starting.
That is because when osd dimensions can be reported as 0 at the very beginning.
Since the width gets calculated based on a fixed height and the aspect ratio,
which is 0, that results in a width of 0 until the next update.
This commit is contained in:
Christoph Heinrich 2023-02-10 22:36:25 +01:00 committed by Dudemanguy
parent 9feeb324ed
commit b7ffe0d16e

View File

@ -2594,6 +2594,9 @@ function tick()
-- render idle message
msg.trace("idle message")
local _, _, display_aspect = mp.get_osd_size()
if display_aspect == 0 then
return
end
local display_h = 360
local display_w = display_h * display_aspect
-- logo is rendered at 2^(6-1) = 32 times resolution with size 1800x1800