[vlc-commits] Fixed YV12 support in opengl video output.

Laurent Aimar git at videolan.org
Tue Jan 17 23:30:13 CET 2012


vlc/vlc-1.2 | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jan 15 00:53:09 2012 +0100| [746fb6ab1b8223e156bc5166d1d7d18f294e764e] | committer: Jean-Baptiste Kempf

Fixed YV12 support in opengl video output.

U/V planes were swapped twice.
(cherry picked from commit 400a9e94170b6dcff6ec2e43ce8b5483ca2a8ede)

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

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

 modules/video_output/opengl.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index cce95bc..98ddd31 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -513,16 +513,15 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
 
     /* Update the texture */
     for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
-        const int plane = vgl->fmt.i_chroma == VLC_CODEC_YV12 && j > 0 ?  (3 - j) : j;
         if (vgl->use_multitexture)
             vgl->ActiveTextureARB(GL_TEXTURE0_ARB + j);
         glBindTexture(vgl->tex_target, vgl->texture[0][j]);
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, picture->p[plane].i_pitch / picture->p[plane].i_pixel_pitch);
+        glPixelStorei(GL_UNPACK_ROW_LENGTH, picture->p[j].i_pitch / picture->p[j].i_pixel_pitch);
         glTexSubImage2D(vgl->tex_target, 0,
                         0, 0,
-                        vgl->fmt.i_width  * vgl->chroma->p[plane].w.num / vgl->chroma->p[plane].w.den,
-                        vgl->fmt.i_height * vgl->chroma->p[plane].h.num / vgl->chroma->p[plane].h.den,
-                        vgl->tex_format, vgl->tex_type, picture->p[plane].p_pixels);
+                        vgl->fmt.i_width  * vgl->chroma->p[j].w.num / vgl->chroma->p[j].w.den,
+                        vgl->fmt.i_height * vgl->chroma->p[j].h.num / vgl->chroma->p[j].h.den,
+                        vgl->tex_format, vgl->tex_type, picture->p[j].p_pixels);
     }
 
     int         last_count = vgl->region_count;



More information about the vlc-commits mailing list