summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r--libvo/vo_gl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index d2eae5c363..d75b7b933f 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -688,14 +688,17 @@ static uint32_t get_image(mp_image_t *mpi) {
return VO_FALSE;
}
if (mpi->flags & MP_IMGFLAG_READABLE) return VO_FALSE;
- if (!gl_buffer)
- GenBuffers(1, &gl_buffer);
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
if (ati_hack) {
int s = 1;
+ // for unexplainable reasons, with width < 512 chroma tends to be messed up
+ // (after ca. 2/3 the previous line repeats all over)
+ if (mpi->width < 512) return VO_FALSE;
while (s < mpi->width) s *= 2;
mpi->width = s;
}
+ if (!gl_buffer)
+ GenBuffers(1, &gl_buffer);
+ 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,