From e357ba0125f7f17a0debe7a9ecab3c065c095244 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 4 Jun 2024 19:43:54 +0200 Subject: [PATCH] GstEngine: Check individual classes when parsing outputs --- src/engine/gstengine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 35527da97..72297f463 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -417,7 +417,8 @@ EngineBase::OutputDetailsList GstEngine::GetOutputsList() const { GstElementFactory *factory = GST_ELEMENT_FACTORY(future->data); const QString metadata = QString::fromUtf8(gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_KLASS)); const QString name = QString::fromUtf8(gst_plugin_feature_get_name(future->data)); - if (metadata.startsWith(QLatin1String("Sink/Audio"), Qt::CaseInsensitive) || name == QStringLiteral("pipewiresink") || (metadata.startsWith(QLatin1String("Source/Audio"), Qt::CaseInsensitive) && name.contains(QLatin1String("sink")))) { + const QStringList classes = metadata.split(QLatin1Char('/')); + if (classes.contains(QStringLiteral("Audio"), Qt::CaseInsensitive) && (classes.contains(QStringLiteral("Sink"), Qt::CaseInsensitive) || (classes.contains(QStringLiteral("Source"), Qt::CaseInsensitive) && name.contains(QStringLiteral("sink"))))) { QString description = QString::fromUtf8(gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_DESCRIPTION)); if (name == QStringLiteral("wasapi2sink") && description == QStringLiteral("Stream audio to an audio capture device through WASAPI")) { description.append(QLatin1Char('2'));