From 3497bbb8a8bd1ef41b5d08d5be7a4b67eb7c4191 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Tue, 16 May 2023 15:32:56 +0800 Subject: [PATCH] va: No need to sort the device after registered The va devices are already registered by the drm path order, so there is no need to sort them again after registered. Part-of: --- .../gst-plugins-bad/sys/va/gstvadevice_linux.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvadevice_linux.c b/subprojects/gst-plugins-bad/sys/va/gstvadevice_linux.c index be080ba855..7d00db48c3 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvadevice_linux.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvadevice_linux.c @@ -58,14 +58,6 @@ gst_va_device_new (GstVaDisplay * display, const gchar * render_device_path, return device; } -static gint -compare_device_path (gconstpointer a, gconstpointer b, gpointer user_data) -{ - const GstVaDevice *pa = a, *pb = b; - - return g_strcmp0 (pa->render_device_path, pb->render_device_path); -} - #ifdef HAVE_GUDEV static gint compare_udev_path (gconstpointer a, gconstpointer b) @@ -110,10 +102,9 @@ gst_va_device_find_devices (void) continue; GST_INFO ("Found VA-API device: %s", path); - g_queue_push_head (&devices, gst_va_device_new (dpy, path, i++)); + g_queue_push_tail (&devices, gst_va_device_new (dpy, path, i++)); } - g_queue_sort (&devices, compare_device_path, NULL); g_list_free_full (udev_devices, g_object_unref); g_object_unref (client); @@ -137,10 +128,9 @@ gst_va_device_find_devices (void) continue; GST_INFO ("Found VA-API device: %s", path); - g_queue_push_head (&devices, gst_va_device_new (dpy, path, j++)); + g_queue_push_tail (&devices, gst_va_device_new (dpy, path, j++)); } - g_queue_sort (&devices, compare_device_path, NULL); return devices.head; } #endif