From 430aa327a84102385b356caef378ceda6b0a97e3 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Tue, 23 Feb 2021 13:47:29 +0800 Subject: [PATCH] va: allocator: replace assert with error log in va alloc. We should print error log rather than assert when the forcc or the rt_format of va allocator is unrecognized. Part-of: --- sys/va/gstvaallocator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/va/gstvaallocator.c b/sys/va/gstvaallocator.c index ab111bb019..a2ca9f0c58 100644 --- a/sys/va/gstvaallocator.c +++ b/sys/va/gstvaallocator.c @@ -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),