summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-07-15 18:57:57 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:44 +0200
commitccb01cc87706b7ad1483cbf55a5266f84989516c (patch)
tree608e00a2ce4c865bc56418737fbd3bf58294978d /libvo
parent93336619b29190285cc0bc08ec7696bcd48399b3 (diff)
downloadmpv-ccb01cc87706b7ad1483cbf55a5266f84989516c.tar.bz2
mpv-ccb01cc87706b7ad1483cbf55a5266f84989516c.tar.xz
vo_gl: Make it possible to select GL_NEAREST scaling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31743 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_gl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index f339f2aee8..9c4f521268 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -526,12 +526,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) |
@@ -559,6 +566,7 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
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;