libs: display: drm: don't fallback to default device if explicitly specified device...
authorHaihao Xiang <haihao.xiang@intel.com>
Fri, 2 Apr 2021 07:43:45 +0000 (15:43 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Thu, 8 Apr 2021 01:38:17 +0000 (09:38 +0800)
Otherwise user will be misled that the specified device is using

This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/issues/305

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/422>

gst-libs/gst/vaapi/gstvaapidisplay_drm.c

index c4e5001..1fc376a 100644 (file)
@@ -350,15 +350,15 @@ gst_vaapi_display_drm_new (const gchar * device_path)
   } else {
     const gchar *user_choice = g_getenv ("GST_VAAPI_DRM_DEVICE");
 
-    if (user_choice && g_str_has_prefix (user_choice, "/dev/dri/")) {
+    if (user_choice) {
       device_paths[num_types] = (gpointer) user_choice;
       types[num_types++] = 0;
+    } else {
+      device_paths[num_types] = (gpointer) device_path;
+      types[num_types++] = DRM_DEVICE_RENDERNODES;
+      device_paths[num_types] = (gpointer) device_path;
+      types[num_types++] = DRM_DEVICE_LEGACY;
     }
-
-    device_paths[num_types] = (gpointer) device_path;
-    types[num_types++] = DRM_DEVICE_RENDERNODES;
-    device_paths[num_types] = (gpointer) device_path;
-    types[num_types++] = DRM_DEVICE_LEGACY;
   }
 
   for (i = 0; i < num_types; i++) {