summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-30 15:41:01 +0200
committerwm4 <wm4@nowhere>2013-05-30 15:56:51 +0200
commit59892dd4cc1bc29bfbc533f61fb404fb919f4906 (patch)
tree8549c0c532cc590fbe7c88ea70a835d000d1212f /video/out
parentbbc865a4da72349682db666713e88e19300d0b6a (diff)
downloadmpv-59892dd4cc1bc29bfbc533f61fb404fb919f4906.tar.bz2
mpv-59892dd4cc1bc29bfbc533f61fb404fb919f4906.tar.xz
gl_common: fix invalid alignment
0 is invalid. The intention of the code turning off any additional alignment, so we need 1. Change a comment: obviously we don't try to set alignment parameters etc.to handle stride correctly, and instead do everything by row.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gl_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index cc3eabb712..67b373d9c3 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -830,10 +830,10 @@ mp_image_t *glGetWindowScreenshot(GL *gl)
gl->GetIntegerv(GL_VIEWPORT, vp);
mp_image_t *image = mp_image_alloc(IMGFMT_RGB24, vp[2], vp[3]);
gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
- gl->PixelStorei(GL_PACK_ALIGNMENT, 0);
+ gl->PixelStorei(GL_PACK_ALIGNMENT, 1);
gl->PixelStorei(GL_PACK_ROW_LENGTH, 0);
gl->ReadBuffer(GL_FRONT);
- //flip image while reading
+ //flip image while reading (and also avoid stride-related trouble)
for (int y = 0; y < vp[3]; y++) {
gl->ReadPixels(vp[0], vp[1] + vp[3] - y - 1, vp[2], 1,
GL_RGB, GL_UNSIGNED_BYTE,