[vlc-devel] [PATCH 16/18] macosx: macosx-gl-display: correct vertical alignment

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Fri Aug 4 19:41:10 CEST 2017


The GL textures are Y inverted, so we must reverse the vertical alignment. As
this value can be 3 or 4, a xor 7 will automatically swap it.
---
 modules/video_output/macosx.m | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index ed012d0531..f57bd00b73 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -397,6 +397,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 cfg_tmp.display.width = bounds.size.width;
                 cfg_tmp.display.height = bounds.size.height;
 
+                /* Reverse vertical alignment as the GL tex are Y inverted */
+                if (cfg_tmp.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
+                    cfg_tmp.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
+                else if (cfg_tmp.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
+                    cfg_tmp.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
+
                 vout_display_place_t place;
                 vout_display_PlacePicture (&place, source, &cfg_tmp, false);
                 @synchronized (sys->glView) {
-- 
2.13.1



More information about the vlc-devel mailing list