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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4643>
This commit is contained in:
He Junyan 2023-05-16 15:32:56 +08:00 committed by GStreamer Marge Bot
parent 8e52e42444
commit 3497bbb8a8

View file

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