aja: Fix infinite loop in device provider

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7928>
This commit is contained in:
Sebastian Dröge 2024-11-20 10:42:13 +02:00 committed by GStreamer Marge Bot
parent dff223fdb4
commit 8a88cd541d

View file

@ -42,13 +42,16 @@ static GList *gst_aja_device_provider_probe(GstDeviceProvider *provider) {
while (CNTV2DeviceScanner::GetDeviceAtIndex(device_idx, device)) { while (CNTV2DeviceScanner::GetDeviceAtIndex(device_idx, device)) {
auto features = device.features(); auto features = device.features();
// Skip non-input / non-output devices // Skip non-input / non-output devices
if (features.GetNumVideoInputs() == 0 && features.GetNumVideoOutputs() == 0) if (features.GetNumVideoInputs() == 0 && features.GetNumVideoOutputs() == 0) {
device_idx += 1;
continue; continue;
}
if (features.GetNumVideoInputs() > 0) if (features.GetNumVideoInputs() > 0)
ret = g_list_prepend(ret, gst_aja_device_new(device, device_idx, TRUE)); ret = g_list_prepend(ret, gst_aja_device_new(device, device_idx, TRUE));
if (features.GetNumVideoOutputs() > 0) if (features.GetNumVideoOutputs() > 0)
ret = g_list_prepend(ret, gst_aja_device_new(device, device_idx, FALSE)); ret = g_list_prepend(ret, gst_aja_device_new(device, device_idx, FALSE));
device_idx += 1;
} }
ret = g_list_reverse(ret); ret = g_list_reverse(ret);