plugins: silence check for direct-rendering mode in video memory.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 3 Jun 2013 08:22:44 +0000 (10:22 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 5 Jun 2013 09:09:37 +0000 (11:09 +0200)
Fix gst_vaapi_video_allocator_new() to silently check for direct-rendering
mode support, and not trigger fatal-criticals if either test surface or
image could not be created. Typical case: pixel format mismatch, e.g. NV12
supported by most hardware vs. I420 supported by most software decoders.

gst/vaapi/gstvaapivideomemory.c

index f8db2e2..e535a60 100644 (file)
@@ -401,8 +401,10 @@ gst_vaapi_video_allocator_new(GstVaapiDisplay *display, GstCaps *caps)
                      GST_VIDEO_INFO_FORMAT_STRING(&allocator->surface_info),
                      allocator->has_direct_rendering ? "yes" : "no");
         } while (0);
-        gst_vaapi_object_unref(surface);
-        gst_vaapi_object_unref(image);
+        if (surface)
+            gst_vaapi_object_unref(surface);
+        if (image)
+            gst_vaapi_object_unref(image);
     }
 
     allocator->image_info = *vip;