display: destroy display on creation failure.
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 13 Oct 2011 21:08:13 +0000 (17:08 -0400)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 7 Dec 2011 16:20:55 +0000 (17:20 +0100)
This allows element to detect that the display creation has actually
failed.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
gst-libs/gst/vaapi/gstvaapidisplay.c

index fe2bc30..ea0780d 100644 (file)
@@ -503,7 +503,8 @@ gst_vaapi_display_constructed(GObject *object)
     GObjectClass *parent_class;
 
     display->priv->create_display = display->priv->display == NULL;
-    gst_vaapi_display_create(display);
+    if (!gst_vaapi_display_create(display))
+        gst_vaapi_display_destroy(display);
 
     parent_class = G_OBJECT_CLASS(gst_vaapi_display_parent_class);
     if (parent_class->constructed)