From 85b6625150839c0b4df121b0789dbe12a16ac352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alicia=20Boya=20Garc=C3=ADa?= Date: Fri, 10 Mar 2023 22:21:42 +0100 Subject: [PATCH] cudaloader: Initialize logging category gstcudaloader.cpp defines GST_DEBUG_CATEGORY (gst_cudaloader_debug); but it wasn't initializing it anywhere. This caused the following error to be logged by gst-plugin-scanner when libcuda.so.1/nvcuda.dll couldn't be loaded, e.g. in systems without CUDA: (gst-plugin-scanner:39618): GStreamer-CRITICAL **: 14:40:22.346: gst_debug_log_full_valist: assertion 'category != NULL' failed This patch fixes the bug by initializing the category in gst_cuda_load_library_once_func() before any logging occurs. Part-of: --- .../gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp index 89dc743963..2382e7975f 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp @@ -146,6 +146,9 @@ gst_cuda_load_library_once_func (void) const gchar *filename = CUDA_LIBNAME; GstNvCodecCudaVTable *vtable; + GST_DEBUG_CATEGORY_INIT (gst_cudaloader_debug, "cudaloader", 0, + "CUDA plugin loader"); + module = g_module_open (filename, G_MODULE_BIND_LAZY); if (module == nullptr) { GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());