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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2138>
This commit is contained in:
Haihao Xiang 2021-04-06 12:03:32 +08:00
parent d67dcb2227
commit 39538adfd6

View file

@ -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);