diff options
author | wm4 <wm4@nowhere> | 2016-12-02 15:26:45 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-12-02 15:26:45 +0100 |
commit | 09238a9bb536982e79b60a264b1d8a4fc0302975 (patch) | |
tree | 04591a027547a233e0e9bfecd05fa38f916000bb /video/out/vo_opengl.c | |
parent | ec74a79e1240eeda7b0bb195b484420052ea0ad8 (diff) | |
download | mpv-09238a9bb536982e79b60a264b1d8a4fc0302975.tar.bz2 mpv-09238a9bb536982e79b60a264b1d8a4fc0302975.tar.xz |
vo_opengl: don't rely on viewport to contain window dimensions
Apparently we don't always set the viewport to window dimensions
anymore, e.g. if nothing is actually rendered. This means the viewport
can contain old values.
The window screenshot code uses the viewport values to guess the default
framebuffer dimensions. With --force-window --idle --no-osc (which draws
nothing and issues a glClear() command only), taking a screenshot would
yield an image with the wrong size and possibly garbage in it. Fix this
by explicitly passing the currently known window dimensions. Abusing the
values stored in the viewport was questionable anyway.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r-- | video/out/vo_opengl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 508ba9cda9..7f65a1eafc 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -272,7 +272,8 @@ static int control(struct vo *vo, uint32_t request, void *data) return VO_NOTIMPL; } case VOCTRL_SCREENSHOT_WIN: { - struct mp_image *screen = gl_read_window_contents(p->gl); + struct mp_image *screen = + gl_read_window_contents(p->gl, vo->dwidth, vo->dheight); if (!screen) break; // redirect to backend // set image parameters according to the display, if possible |