diff options
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index e3eb4d1abf..1f32844c07 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1671,7 +1671,7 @@ static void uninit_video(struct gl_video *p) fbotex_uninit(p, &p->indirect_fbo); fbotex_uninit(p, &p->scale_sep_fbo); - + // Invalidate image_params to ensure that gl_video_config() will call // init_video() on uninitialized gl_video. p->image_params = (struct mp_image_params){0}; @@ -2017,16 +2017,14 @@ struct mp_image *gl_video_download_image(struct gl_video *p) struct video_image *vimg = &p->image; - if (!p->have_image || !gl->GetTexImage) + if (!p->have_image) return NULL; - if (p->hwdec_active && p->hwdec->driver->download_image) { - struct mp_image *dlimage = - p->hwdec->driver->download_image(p->hwdec, vimg->hwimage); - if (dlimage) - mp_image_set_attributes(dlimage, &p->image_params); - return dlimage; - } + if (p->hwdec_active) + return mp_image_new_ref(vimg->hwimage); + + if (!gl->GetTexImage) + return NULL; set_image_textures(p, vimg, NULL); |