diff options
author | Reynaldo H. Verdejo Pinochet <reynaldo@collabora.com> | 2012-09-10 10:55:53 -0300 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo@collabora.com> | 2012-09-10 10:55:53 -0300 |
commit | fc6aaf8cefbc1f80f7f1bfeb31fc2f3fafd94a09 (patch) | |
tree | b404e83acf118c0296b493c3629a93dc84f225f0 | |
parent | 2266dcb9a37d8ffdd683bdd2403e7f2a405a0ff0 (diff) |
Unlock and destroy surface at setup failure
-rw-r--r-- | sys/android/gstvidroidsink.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/android/gstvidroidsink.c b/sys/android/gstvidroidsink.c index 0c77f0c58..838e12f96 100644 --- a/sys/android/gstvidroidsink.c +++ b/sys/android/gstvidroidsink.c @@ -266,14 +266,20 @@ GST_BOILERPLATE_FULL (GstViDroidSink, gst_vidroidsink, GstVideoSink, == EGL_FALSE) { GST_CAT_ERROR (GST_CAT_DEFAULT, "Unable to query surface for bitmap pointer"); - goto EGL_ERROR; + goto EGL_ERROR_LOCKED; } return buffer; +EGL_ERROR_LOCKED: + my_eglUnlockSurfaceKHR (display, pix_surface); EGL_ERROR: GST_CAT_ERROR (GST_CAT_DEFAULT, "EGL call returned error %x", eglGetError ()); - /* XXX: Free native pixmap here */ + if (!eglDestroySurface (display, pix_surface)) { + GST_CAT_ERROR (GST_CAT_DEFAULT, "Couldn't destroy surface"); + GST_CAT_ERROR (GST_CAT_DEFAULT, "EGL call returned error %x", + eglGetError ()); + } return NULL; } |