plugins: fix creation of video buffer from surface proxy.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 25 Jul 2012 13:11:51 +0000 (15:11 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 25 Jul 2012 13:11:51 +0000 (15:11 +0200)
Fix a regression introduced with commit 8ef490a.

gst/vaapi/gstvaapipluginbuffer.c

index 7005a2b..33cb917 100644 (file)
@@ -120,10 +120,15 @@ GstBuffer *
 gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy)
 {
     GstVaapiDisplay *display;
+    GstVaapiSurface *surface;
 
     g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
 
-    display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(proxy));
+    surface = gst_vaapi_surface_proxy_get_surface(proxy);
+    if (!surface)
+        return NULL;
+
+    display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(surface));
     if (!display)
         return NULL;