From 545b33b647532718665cb3b1138a1d951c657666 Mon Sep 17 00:00:00 2001 From: Paulchen Panther Date: Sun, 14 Feb 2021 16:36:50 +0100 Subject: [PATCH] Do not show unsupported grabbers --- libsrc/grabber/mediafoundation/MFGrabber.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libsrc/grabber/mediafoundation/MFGrabber.cpp b/libsrc/grabber/mediafoundation/MFGrabber.cpp index b49f8d75..4252558f 100644 --- a/libsrc/grabber/mediafoundation/MFGrabber.cpp +++ b/libsrc/grabber/mediafoundation/MFGrabber.cpp @@ -435,11 +435,12 @@ void MFGrabber::enumVideoCaptureDevices() { QList devicePropertyList; QString dev = QString::fromUtf16((const ushort*)name); - Debug(_log, "Found capture device: %s", QSTRING_CSTR(dev)); IMFMediaSource *pSource = nullptr; if(SUCCEEDED(devices[i]->ActivateObject(IID_PPV_ARGS(&pSource)))) { + Debug(_log, "Found capture device: %s", QSTRING_CSTR(dev)); + IMFMediaType *pType = nullptr; IMFSourceReader* reader; if(SUCCEEDED(MFCreateSourceReaderFromMediaSource(pSource, NULL, &reader))) @@ -481,7 +482,8 @@ void MFGrabber::enumVideoCaptureDevices() pSource->Release(); } - _deviceProperties.insert(dev, devicePropertyList); + if (!devicePropertyList.isEmpty()) + _deviceProperties.insert(dev, devicePropertyList); } CoTaskMemFree(symlink);