[MPlayer-cvslog] r29938 - trunk/libvo/gl_common.c

reimar subversion at mplayerhq.hu
Sat Nov 21 00:36:17 CET 2009


Author: reimar
Date: Sat Nov 21 00:36:16 2009
New Revision: 29938

Log:
Use calloc to allocate a rather large (currently 32k) array instead of
putting it on the stack, performance should not matter much here.

Modified:
   trunk/libvo/gl_common.c

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Fri Nov 20 11:32:45 2009	(r29937)
+++ trunk/libvo/gl_common.c	Sat Nov 21 00:36:16 2009	(r29938)
@@ -695,7 +695,7 @@ static void store_weights(float x, GLflo
  * \param unit texture unit to attach texture to
  */
 static void gen_spline_lookup_tex(GLenum unit) {
-  GLfloat tex[4 * LOOKUP_BSPLINE_RES];
+  GLfloat *tex = calloc(4 * LOOKUP_BSPLINE_RES, sizeof(*tex));
   GLfloat *tp = tex;
   int i;
   for (i = 0; i < LOOKUP_BSPLINE_RES; i++) {
@@ -712,6 +712,7 @@ static void gen_spline_lookup_tex(GLenum
   glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
   glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
   ActiveTexture(GL_TEXTURE0);
+  free(tex);
 }
 
 static const char *bilin_filt_template =


More information about the MPlayer-cvslog mailing list