[vlc-commits] No functionnal changes (opengl).

Laurent Aimar git at videolan.org
Wed May 25 23:21:18 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed May 25 22:57:00 2011 +0200| [5d527f369d1a5a3296246b23b61f3962768b1b03] | committer: Laurent Aimar

No functionnal changes (opengl).

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

 modules/video_output/opengl.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 752fe82..b9bc95d 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -176,14 +176,6 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
 #endif
 
     vgl->chroma = vlc_fourcc_GetChromaDescription(vgl->fmt.i_chroma);
-    *fmt = vgl->fmt;
-
-    /* */
-    for (int i = 0; i < VLCGL_TEXTURE_COUNT; i++) {
-        vgl->texture[i] = 0;
-        vgl->buffer[i]  = NULL;
-    }
-    vgl->pool = NULL;
 
     bool supports_npot = false;
 #if USE_OPENGL_ES == 2
@@ -197,13 +189,13 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
 
     /* Texture size */
     if (supports_npot) {
-        vgl->tex_width  = fmt->i_width;
-        vgl->tex_height = fmt->i_height;
+        vgl->tex_width  = vgl->fmt.i_width;
+        vgl->tex_height = vgl->fmt.i_height;
     }
     else {
         /* A texture must have a size aligned on a power of 2 */
-        vgl->tex_width  = GetAlignedSize(fmt->i_width);
-        vgl->tex_height = GetAlignedSize(fmt->i_height);
+        vgl->tex_width  = GetAlignedSize(vgl->fmt.i_width);
+        vgl->tex_height = GetAlignedSize(vgl->fmt.i_height);
     }
 
     /* */
@@ -215,6 +207,15 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     glClear(GL_COLOR_BUFFER_BIT);
 
     vlc_gl_Unlock(vgl->gl);
+
+    /* */
+    for (int i = 0; i < VLCGL_TEXTURE_COUNT; i++) {
+        vgl->texture[i] = 0;
+        vgl->buffer[i]  = NULL;
+    }
+    vgl->pool = NULL;
+
+    *fmt = vgl->fmt;
     return vgl;
 }
 



More information about the vlc-commits mailing list