summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-08 13:39:33 +0100
committerwm4 <wm4@nowhere>2016-02-08 13:39:33 +0100
commit9f6dfaabf99b29b1b9caaf9e2a97128964a01b05 (patch)
treeacad044a325e82a605ba554dd0f6b47facbed42c /video
parentf04e7bc529f935002086cb25c936111aa266dedb (diff)
downloadmpv-9f6dfaabf99b29b1b9caaf9e2a97128964a01b05.tar.bz2
mpv-9f6dfaabf99b29b1b9caaf9e2a97128964a01b05.tar.xz
vo_opengl: vdpau: call glVDPAUFiniNV only if initialized
This is "more correct". See #2798.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/hwdec_vdpau.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/video/out/opengl/hwdec_vdpau.c b/video/out/opengl/hwdec_vdpau.c
index 2396d8ad5d..b1d49622fc 100644
--- a/video/out/opengl/hwdec_vdpau.c
+++ b/video/out/opengl/hwdec_vdpau.c
@@ -37,6 +37,7 @@ struct priv {
uint64_t preemption_counter;
struct mp_image_params image_params;
GLuint gl_texture;
+ bool vdpgl_initialized;
GLvdpauSurfaceNV vdpgl_surface;
VdpOutputSurface vdp_surface;
struct mp_vdpau_mixer *mixer;
@@ -78,13 +79,12 @@ static void destroy_objects(struct gl_hwdec *hw)
glCheckError(gl, hw->log, "Before uninitializing OpenGL interop");
- gl->VDPAUFiniNV();
+ if (p->vdpgl_initialized)
+ gl->VDPAUFiniNV();
- // If the GL/vdpau state is not initialized, above calls raises an error.
- while (1) {
- if (gl->GetError() == GL_NO_ERROR)
- break;
- }
+ p->vdpgl_initialized = false;
+
+ glCheckError(gl, hw->log, "After uninitializing OpenGL interop");
}
static void destroy(struct gl_hwdec *hw)
@@ -142,6 +142,8 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->VDPAUInitNV(BRAINDEATH(p->ctx->vdp_device), p->ctx->get_proc_address);
+ p->vdpgl_initialized = true;
+
vdp_st = vdp->output_surface_create(p->ctx->vdp_device,
VDP_RGBA_FORMAT_B8G8R8A8,
params->w, params->h, &p->vdp_surface);