glcontext: Make gst_gl_context_egl_activate fail if the old surface could not be destroyed

https://bugzilla.gnome.org/show_bug.cgi?id=746251
This commit is contained in:
Matthieu Bouron 2015-04-17 14:24:28 +02:00 committed by Sebastian Dröge
parent f283d72636
commit 93d2e67cbc

View file

@ -523,8 +523,13 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate)
"Handle changed (have:%p, now:%p), switching surface",
(void *) egl->window_handle, (void *) handle);
if (egl->egl_surface) {
eglDestroySurface (egl->egl_display, egl->egl_surface);
result = eglDestroySurface (egl->egl_display, egl->egl_surface);
egl->egl_surface = EGL_NO_SURFACE;
if (!result) {
GST_ERROR_OBJECT (context, "Failed to destroy old window surface: %s",
gst_gl_context_egl_get_error_string ());
goto done;
}
}
egl->egl_surface =
eglCreateWindowSurface (egl->egl_display, egl->egl_config, handle,