diff options
author | wm4 <wm4@nowhere> | 2015-09-25 10:02:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-25 10:02:54 +0200 |
commit | 5786d074509212ec926a9a595d54af8add4ee832 (patch) | |
tree | 51b6da431bd57fcc7a2c17893e5088624b45a4c3 | |
parent | 8d8a2045bde250a50228df7fa8f24124ec5b0251 (diff) |
vo_opengl: vaapi: fix cleanup
Don't call eglDestroyImageKHR() on the same ID possibly more than once.
Clear the image reference on termination, or we would leak up to 1 image
per VO recreation.
-rw-r--r-- | video/out/opengl/hwdec_vaegl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_vaegl.c b/video/out/opengl/hwdec_vaegl.c index b084d7203d..33d8972b0a 100644 --- a/video/out/opengl/hwdec_vaegl.c +++ b/video/out/opengl/hwdec_vaegl.c @@ -50,6 +50,7 @@ static void unref_image(struct gl_hwdec *hw) for (int n = 0; n < 4; n++) { if (p->images[n]) hw->gl->DestroyImageKHR(eglGetCurrentDisplay(), p->images[n]); + p->images[n] = 0; } va_lock(p->ctx); @@ -83,6 +84,7 @@ static void destroy_textures(struct gl_hwdec *hw) static void destroy(struct gl_hwdec *hw) { struct priv *p = hw->priv; + unref_image(hw); destroy_textures(hw); va_destroy(p->ctx); } |