nvcodec: Fix reporting of CuDeviceGetCount error

cuda_ret is was always going to be CUDA_SUCCESS in the error log.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3776>
This commit is contained in:
Nirbheek Chauhan 2023-01-24 11:16:38 +05:30 committed by GStreamer Marge Bot
parent 2048a0a4d9
commit 43ae6b421b

View file

@ -115,7 +115,8 @@ plugin_init (GstPlugin * plugin)
return TRUE;
}
if (CuDeviceGetCount (&dev_count) != CUDA_SUCCESS || !dev_count) {
cuda_ret = CuDeviceGetCount (&dev_count);
if (cuda_ret != CUDA_SUCCESS || !dev_count) {
GST_WARNING ("No available device, ret: 0x%x", (gint) cuda_ret);
return TRUE;
}