From 9a873cc53bbfd98ce9668d91ad7437d5d0ca6283 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 12 Sep 2016 16:35:25 +0200 Subject: 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. --- video/out/vo_opengl.c | 10 +++++----- 1 file 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; } -- cgit v1.2.3