[MPlayer-cvslog] r31743 - trunk/libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Thu Jul 15 20:57:57 CEST 2010


Author: reimar
Date: Thu Jul 15 20:57:57 2010
New Revision: 31743

Log:
Make it possible to select GL_NEAREST scaling.

Modified:
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Thu Jul 15 20:50:57 2010	(r31742)
+++ trunk/libvo/vo_gl.c	Thu Jul 15 20:57:57 2010	(r31743)
@@ -507,12 +507,19 @@ static void autodetectGlExtensions(void)
          ati_hack, force_pbo, use_rectangle, use_yuv);
 }
 
+static GLint get_scale_type(int chroma) {
+  int nearest = (chroma ? cscale : lscale) & 64;
+  if (nearest)
+    return mipmap_gen ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
+  return mipmap_gen ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR;
+}
+
 /**
  * \brief Initialize a (new or reused) OpenGL context.
  * set global gl-related variables to their default values
  */
 static int initGl(uint32_t d_width, uint32_t d_height) {
-  int scale_type = mipmap_gen ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR;
+  GLint scale_type = get_scale_type(0);
   autodetectGlExtensions();
   gl_target = use_rectangle == 1 ? GL_TEXTURE_RECTANGLE : GL_TEXTURE_2D;
   yuvconvtype = SET_YUV_CONVERSION(use_yuv) |
@@ -540,6 +547,7 @@ static int initGl(uint32_t d_width, uint
   if (is_yuv) {
     int i;
     int xs, ys;
+    scale_type = get_scale_type(1);
     mp_get_chroma_shift(image_format, &xs, &ys);
     mpglGenTextures(21, default_texs);
     default_texs[21] = 0;


More information about the MPlayer-cvslog mailing list