[vlc-commits] macosx: macosx-gl-display: correct vertical alignment

Victorien Le Couviour--Tuffet git at videolan.org
Mon Aug 7 18:04:09 CEST 2017


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Fri Aug  4 19:41:10 2017 +0200| [c09f48224da32954b06e3f0ff7f10b35749154b5] | committer: Jean-Baptiste Kempf

macosx: macosx-gl-display: correct vertical alignment

The GL textures are Y inverted, so we must reverse the vertical alignment.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c09f48224da32954b06e3f0ff7f10b35749154b5
---

 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 cc24a2ed4e..dd132fef20 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -391,6 +391,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, &vd->source, &cfg_tmp, false);
                 @synchronized (sys->glView) {



More information about the vlc-commits mailing list