diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2016-01-22 21:35:51 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2016-01-28 00:55:58 -0800 |
commit | e927ff16661e7b5bd42cba2aa3f1bd3d4ac148ff (patch) | |
tree | 9579a5ef8c22e653209cf33d2a6e5069f1a53693 /audio/out/ao_wasapi_changenotify.c | |
parent | f1072be3b795b1ca360be62cb22581250cd2d6d3 (diff) | |
download | mpv-e927ff16661e7b5bd42cba2aa3f1bd3d4ac148ff.tar.bz2 mpv-e927ff16661e7b5bd42cba2aa3f1bd3d4ac148ff.tar.xz |
ao_wasapi: correct check for specified device on default change
Correctly avoid a reload if the current device was specified by the user through
--audio-device. Previously, we only recognized if the user had specified
--ao=wasapi:device=.
Diffstat (limited to 'audio/out/ao_wasapi_changenotify.c')
-rw-r--r-- | audio/out/ao_wasapi_changenotify.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c index c25b806c8e..661e957bcc 100644 --- a/audio/out/ao_wasapi_changenotify.c +++ b/audio/out/ao_wasapi_changenotify.c @@ -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; } |