plugins: simlpify gst_vaapi_create_display() helper.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 15 Jul 2013 09:58:31 +0000 (11:58 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 15 Jul 2013 09:58:31 +0000 (11:58 +0200)
Simplify gst_vaapi_create_display() helper as gst_vaapi_display_XXX_new()
performs the necessary validation checks for the underlying VA display
prior to returning to the caller. So, if an error occurred, then NULL is
really returned in that case.

gst/vaapi/gstvaapipluginutil.c

index 86d28ee..a1dbad8 100644 (file)
@@ -99,13 +99,8 @@ gst_vaapi_create_display(GstVaapiDisplayType *display_type)
 
         display = m->create_display(NULL);
         if (display) {
-            /* FIXME: allocator should return NULL if an error occurred */
-            if (gst_vaapi_display_get_display(display)) {
-                *display_type = m->type;
-                break;
-            }
-            gst_vaapi_display_unref(display);
-            display = NULL;
+            *display_type = m->type;
+            break;
         }
 
         if (display_type != GST_VAAPI_DISPLAY_TYPE_ANY)