From cec7ac2a1b4e114edf6fe85e51286b034b037e94 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 2 Mar 2022 05:01:42 +0900 Subject: [PATCH] cudacontext: Remove unnecessary cuInit() call It's already called at plugin init time Part-of: --- .../gst-plugins-bad/sys/nvcodec/gstcudacontext.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstcudacontext.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstcudacontext.c index 8a85d5d2e0..dfa515583f 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstcudacontext.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstcudacontext.c @@ -134,11 +134,9 @@ gst_cuda_context_get_property (GObject * object, guint prop_id, static void gst_cuda_context_constructed (GObject * object) { - static gsize once = 0; GstCudaContext *context = GST_CUDA_CONTEXT (object); GstCudaContextPrivate *priv = context->priv; CUcontext cuda_ctx, old_ctx; - gboolean ret = TRUE; CUdevice cdev = 0, cuda_dev = -1; gint dev_count = 0; gchar name[256]; @@ -147,17 +145,6 @@ gst_cuda_context_constructed (GObject * object) gint tex_align = 0; GList *iter; - if (g_once_init_enter (&once)) { - if (CuInit (0) != CUDA_SUCCESS) { - GST_ERROR_OBJECT (context, "Failed to cuInit"); - ret = FALSE; - } - g_once_init_leave (&once, ret); - - if (!ret) - return; - } - if (!gst_cuda_result (CuDeviceGetCount (&dev_count)) || dev_count == 0) { GST_WARNING ("No CUDA devices detected"); return;