summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi_changenotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_wasapi_changenotify.c')
-rw-r--r--audio/out/ao_wasapi_changenotify.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c
index c2bce0d42b..661e957bcc 100644
--- a/audio/out/ao_wasapi_changenotify.c
+++ b/audio/out/ao_wasapi_changenotify.c
@@ -3,18 +3,18 @@
*
* Original author: Jonathan Yong <10walls@gmail.com>
*
- * mpv is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * mpv is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
* mpv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with mpv. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wchar.h>
@@ -122,7 +122,6 @@ static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_OnDefaultDeviceChanged(
{
change_notify *change = (change_notify *)This;
struct ao *ao = change->ao;
- struct wasapi_state *state = ao->priv;
// don't care about "eCapture" or non-"eMultimedia" roles
if (flow == eCapture || role != eMultimedia) return S_OK;
@@ -133,9 +132,10 @@ static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_OnDefaultDeviceChanged(
ao_hotplug_event(ao);
} else {
// stay on the device the user specified
- if (state->opt_device) {
+ bstr device = wasapi_get_specified_device_string(ao);
+ if (device.len) {
MP_VERBOSE(ao, "OnDefaultDeviceChanged triggered: "
- "staying on specified device %s\n", state->opt_device);
+ "staying on specified device %.*s\n", BSTR_P(device));
return S_OK;
}