summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-12 16:35:25 +0200
committerwm4 <wm4@nowhere>2016-09-12 19:58:58 +0200
commit9a873cc53bbfd98ce9668d91ad7437d5d0ca6283 (patch)
tree0bc973a3cfe4a949ba8c7b8169522ac8832908b3 /video
parent274e71ee8b774d6c9c69929a548a83c343202be1 (diff)
downloadmpv-9a873cc53bbfd98ce9668d91ad7437d5d0ca6283.tar.bz2
mpv-9a873cc53bbfd98ce9668d91ad7437d5d0ca6283.tar.xz
vo_opengl: redirect window screenshot requests to backend
If the glReadPixels method is not available, let the backend do it. Useful for the next commit.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_opengl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 36645ec0cd..2517ba7412 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -300,12 +300,12 @@ static int control(struct vo *vo, uint32_t request, void *data)
}
case VOCTRL_SCREENSHOT_WIN: {
struct mp_image *screen = gl_read_window_contents(p->gl);
+ if (!screen)
+ break; // redirect to backend
// set image parameters according to the display, if possible
- if (screen) {
- screen->params.color = gl_video_get_output_colorspace(p->renderer);
- if (p->glctx->flip_v)
- mp_image_vflip(screen);
- }
+ screen->params.color = gl_video_get_output_colorspace(p->renderer);
+ if (p->glctx->flip_v)
+ mp_image_vflip(screen);
*(struct mp_image **)data = screen;
return true;
}