From fd1e48ecc51498d6769668d936997b81115de435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 4 Aug 2026 00:09:26 +0200 Subject: [PATCH] WASAPI: Add error check for RegisterEndpointNotificationCallback Log a warning if registering for device change notifications fails. This is non-fatal but means automatic device switching won't work. --- Windows/WASAPIContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Windows/WASAPIContext.cpp b/Windows/WASAPIContext.cpp index a7ca22ef38..f932dd9692 100644 --- a/Windows/WASAPIContext.cpp +++ b/Windows/WASAPIContext.cpp @@ -81,7 +81,10 @@ WASAPIContext::WASAPIContext() : notificationClient_(this) { enumerator_ = nullptr; return; } - enumerator_->RegisterEndpointNotificationCallback(¬ificationClient_); + hr = enumerator_->RegisterEndpointNotificationCallback(¬ificationClient_); + if (FAILED(hr)) { + WARN_LOG(Log::Audio, "Failed to register endpoint notification callback: %08lx", hr); + } } WASAPIContext::~WASAPIContext() {