From 0d3068810a8b743a7f95a7fe84e6939e72d95494 Mon Sep 17 00:00:00 2001
From: barracuda156 <vital.had@gmail.com>
Date: Sat, 5 Aug 2023 05:10:09 +0800
Subject: [PATCH] Do not err out on no acceleration

---
 modules/video_output/macosx.m | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git modules/video_output/macosx.m modules/video_output/macosx.m
index d898f61d57..99d419b0d3 100644
--- modules/video_output/macosx.m
+++ modules/video_output/macosx.m
@@ -144,7 +144,7 @@ static int Open (vlc_object_t *this)
         return VLC_ENOMEM;
 
     if (!CGDisplayUsesOpenGLAcceleration (kCGDirectMainDisplay))
-        msg_Err (this, "no OpenGL hardware acceleration found. this can lead to slow output and unexpected results");
+        msg_Dbg (this, "no OpenGL hardware acceleration found. this can lead to slow output and unexpected results");
 
     vd->sys = sys;
     sys->pool = NULL;
@@ -215,6 +215,7 @@ static int Open (vlc_object_t *this)
     sys->gl.getProcAddress = OurGetProcAddress;
     sys->gl.sys = sys;
     const vlc_fourcc_t *subpicture_chromas;
+    video_format_t fmt = vd->fmt;
 
     sys->vgl = vout_display_opengl_New (&vd->fmt, &subpicture_chromas, &sys->gl);
     if (!sys->vgl) {
@@ -239,7 +240,7 @@ static int Open (vlc_object_t *this)
     vd->control = Control;
 
     /* */
-    vout_display_SendEventDisplaySize (vd, vd->fmt.i_visible_width, vd->fmt.i_visible_height, false);
+    vout_display_SendEventDisplaySize (vd, vd->source.i_visible_width, vd->source.i_visible_height, false);
 
     return VLC_SUCCESS;
 
@@ -376,9 +377,11 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             vout_display_cfg_t cfg_tmp = *cfg;
             NSRect bounds;
             /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
+#if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
             if (OSX_LION)
                 bounds = [sys->glView convertRectToBacking:[sys->glView bounds]];
             else
+#endif
                 bounds = [sys->glView bounds];
             cfg_tmp.display.width = bounds.size.width;
             cfg_tmp.display.height = bounds.size.height;
@@ -631,9 +634,11 @@ static void OpenglSwap (vlc_gl_t *gl)
 
     NSRect bounds;
     /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
+#if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
     if (OSX_LION)
         bounds = [self convertRectToBacking:[self bounds]];
     else
+#endif
         bounds = [self bounds];
     vout_display_place_t place;
 
@@ -774,7 +779,7 @@ static void OpenglSwap (vlc_gl_t *gl)
     NSRect videoRect = [self bounds];
     BOOL b_inside = [self mouse: ml inRect: videoRect];
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED > 1070
+#if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
     if (OSX_LION) {
         ml = [self convertPointToBacking: ml];
         videoRect = [self convertRectToBacking: videoRect];