From b7ffe0d16eec8153d9609382997baaf6a29e5e4f Mon Sep 17 00:00:00 2001
From: Christoph Heinrich <christoph.heinrich@student.tugraz.at>
Date: Fri, 10 Feb 2023 22:36:25 +0100
Subject: [PATCH] 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.
---
 player/lua/osc.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index bf3992faa9..f3d4e84fa1 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -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