va: allocator: replace assert with error log in va alloc.
authorHe Junyan <junyan.he@intel.com>
Tue, 23 Feb 2021 05:47:29 +0000 (13:47 +0800)
committerHe Junyan <junyan.he@intel.com>
Tue, 23 Feb 2021 05:47:29 +0000 (13:47 +0800)
We should print error log rather than assert when the forcc or
the rt_format of va allocator is unrecognized.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1636>

sys/va/gstvaallocator.c

index ab111bb..a2ca9f0 100644 (file)
@@ -1381,7 +1381,10 @@ gst_va_allocator_alloc (GstAllocator * allocator)
 
   self = GST_VA_ALLOCATOR (allocator);
 
-  g_return_val_if_fail (self->rt_format != 0, NULL);
+  if (self->fourcc == 0 || self->rt_format == 0) {
+    GST_ERROR_OBJECT (self, "Unknown fourcc or chroma format");
+    return NULL;
+  }
 
   if (!_create_surfaces (self->display, self->rt_format, self->fourcc,
           GST_VIDEO_INFO_WIDTH (&self->info),