[vlc-commits] yuv: reorient video

Rémi Denis-Courmont git at videolan.org
Fri Mar 14 17:39:32 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar 14 18:37:06 2014 +0200| [43161ef309017d3d592e7d07bc34eb3d54228cf8] | committer: Rémi Denis-Courmont

yuv: reorient video

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

 modules/video_output/yuv.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c
index f61d7b5..483be24 100644
--- a/modules/video_output/yuv.c
+++ b/modules/video_output/yuv.c
@@ -152,7 +152,8 @@ static int Open(vlc_object_t *object)
     free(name);
 
     /* */
-    video_format_t fmt = vd->fmt;
+    video_format_t fmt;
+    video_format_ApplyRotation(&fmt, &vd->fmt);
     fmt.i_chroma = chroma;
     video_format_FixRgb(&fmt);
 
@@ -202,8 +203,17 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
 
     /* */
     video_format_t fmt = vd->fmt;
-    fmt.i_sar_num = vd->source.i_sar_num;
-    fmt.i_sar_den = vd->source.i_sar_den;
+
+    if (ORIENT_IS_SWAP(vd->source.orientation))
+    {
+        fmt.i_sar_num = vd->source.i_sar_den;
+        fmt.i_sar_den = vd->source.i_sar_num;
+    }
+    else
+    {
+        fmt.i_sar_num = vd->source.i_sar_num;
+        fmt.i_sar_den = vd->source.i_sar_den;
+    }
 
     /* */
     char type;



More information about the vlc-commits mailing list