changeset 28064:4d76c7e31760

Simplify, do not duplicate buffer size calculation
author reimar
date Fri, 05 Dec 2008 20:50:43 +0000
parents a318969a4f45
children aec8703ff07f
files libvo/vo_gl.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Fri Dec 05 19:01:49 2008 +0000
+++ b/libvo/vo_gl.c	Fri Dec 05 20:50:43 2008 +0000
@@ -698,9 +698,9 @@
   BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
   mpi->stride[0] = mpi->width * mpi->bpp / 8;
   if (mpi->stride[0] * mpi->height > gl_buffersize) {
-    BufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[0] * mpi->height,
+    gl_buffersize = mpi->stride[0] * mpi->height;
+    BufferData(GL_PIXEL_UNPACK_BUFFER, gl_buffersize,
                NULL, GL_DYNAMIC_DRAW);
-    gl_buffersize = mpi->stride[0] * mpi->height;
   }
   if (!gl_bufferptr)
     gl_bufferptr = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);