diff --git a/cscore/src/main/native/windows/UsbCameraImpl.cpp b/cscore/src/main/native/windows/UsbCameraImpl.cpp index 5ec4c84cc7..f0ed0b3d1f 100644 --- a/cscore/src/main/native/windows/UsbCameraImpl.cpp +++ b/cscore/src/main/native/windows/UsbCameraImpl.cpp @@ -450,6 +450,15 @@ bool UsbCameraImpl::DeviceConnect() { return false; } + CS_Status st = 0; + auto devices = EnumerateUsbCameras(&st); + + for (auto&& device : devices) { + if (device.path == m_path) { + SetDescription(device.name); + } + } + if (!m_properties_cached) { SDEBUG3("caching properties"); DeviceCacheProperties(); @@ -933,9 +942,7 @@ std::vector EnumerateUsbCameras(CS_Status* status) { // Ensure we are initialized by grabbing the message pump // GetMessagePump(); - ComPtr ppSource; std::wstring_convert> utf8_conv; - ComPtr pSource; ComPtr pAttributes; IMFActivate** ppDevices = nullptr; @@ -988,7 +995,6 @@ done: } } CoTaskMemFree(ppDevices); - pSource.Reset(); return retval; }