[vlc-devel] [PATCH 3/4] opengl: Take w.num into account when calculating the buffer size

Martin Storsjö martin at martin.st
Tue Mar 12 19:02:08 CET 2013


---
I'm not totally sure that this code handles the num/den stuff
properly, but this change at least makes it consistent, even
if that is consistently wrong.
---
 modules/video_output/opengl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 193db2c..2dc1e9c 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -710,7 +710,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
         if ( (picture->p[j].i_pitch / picture->p[j].i_pixel_pitch) != (unsigned int)
              ( picture->format.i_visible_width * vgl->chroma->p[j].w.num / vgl->chroma->p[j].w.den ) )
         {
-            uint8_t *new_plane = malloc( picture->format.i_visible_width * vgl->fmt.i_visible_height * vgl->chroma->p[j].h.num / (vgl->chroma->p[j].h.den *  vgl->chroma->p[j].w.den ) );
+            uint8_t *new_plane = malloc( picture->format.i_visible_width * vgl->fmt.i_visible_height * vgl->chroma->p[j].w.num * vgl->chroma->p[j].h.num / (vgl->chroma->p[j].h.den * vgl->chroma->p[j].w.den ) );
             uint8_t *destination = new_plane;
             const uint8_t *source = picture->p[j].p_pixels;
 
-- 
1.7.10.4




More information about the vlc-devel mailing list