From 39538adfd6afc25fa97727cb3bad672766901360 Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Tue, 6 Apr 2021 12:03:32 +0800 Subject: [PATCH] msdk: don't fall back to the default device Ohterwise when user set a wrong device, the warning message doesn't get printed if user doesn't set a right debug level in the environment, this behavior might mislead user that the wrong device is being used. This fixed https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1567 Part-of: --- sys/msdk/gstmsdkcontext.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/msdk/gstmsdkcontext.c b/sys/msdk/gstmsdkcontext.c index df635c7ffe..294b49ef5b 100644 --- a/sys/msdk/gstmsdkcontext.c +++ b/sys/msdk/gstmsdkcontext.c @@ -87,20 +87,19 @@ get_device_id (void) drmVersionPtr drm_version = drmGetVersion (fd); if (!drm_version || strncmp (drm_version->name, "i915", 4)) { - GST_WARNING ("The specified device isn't an Intel device, " - "use the default device instead"); + GST_ERROR ("The specified device isn't an Intel device"); drmFreeVersion (drm_version); close (fd); fd = -1; } else { GST_DEBUG ("Opened the specified drm device %s", user_choice); drmFreeVersion (drm_version); - return fd; } } else { - GST_WARNING ("The specified device isn't a valid drm device, " - "use the default device instead"); + GST_ERROR ("The specified device isn't a valid drm device"); } + + return fd; } client = g_udev_client_new (NULL);