From cb463b569a360a9b405349852227458864055548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 11 Oct 2019 14:29:02 +0200 Subject: [PATCH] WASAPI: Discovered by chance that pwstrDeviceId can be null. Treating it as a new device. --- Windows/WASAPIStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Windows/WASAPIStream.cpp b/Windows/WASAPIStream.cpp index d92442ae37..22c584bbb5 100644 --- a/Windows/WASAPIStream.cpp +++ b/Windows/WASAPIStream.cpp @@ -91,7 +91,8 @@ public: return S_OK; } - if (!wcscmp(currentDevice_, pwstrDeviceId)) { + // pwstrDeviceId can be null. We consider that a new device, I think? + if (pwstrDeviceId && !wcscmp(currentDevice_, pwstrDeviceId)) { // Already the current device, nothing to do. return S_OK; }