]> git.sesse.net Git - vlc/commitdiff
xcb-xv: fix YV12 again
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 9 Sep 2009 15:52:26 +0000 (18:52 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 9 Sep 2009 15:52:26 +0000 (18:52 +0300)
Chrominance planes swap had been broken by the vout rework.

modules/video_output/xcb/xvideo.c

index 95be5c7185de71d84faf8a428c8a1902429aa2a9..fbd355e5588c599c25060dab08d8855afb059db4 100644 (file)
@@ -560,6 +560,13 @@ static picture_t *Get (vout_display_t *vd)
             /* We assume that offsets[0] is zero */
             for (int i = 1; i < pic->i_planes; i++)
                 res->p[i].p_pixels = res->p[0].p_pixels + offsets[i];
+            if (vd->fmt.i_chroma == VLC_CODEC_YV12)
+            {   /* YVU: swap U and V planes */
+                uint8_t *buf = res->p[2].p_pixels;
+                res->p[2].p_pixels = res->p[1].p_pixels;
+                res->p[1].p_pixels = buf;
+            }
+
             pic_array[count] = picture_NewFromResource (&vd->fmt, res);
             if (!pic_array[count])
             {