summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi_utils.c
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2016-01-22 21:35:51 -0800
committerKevin Mitchell <kevmitch@gmail.com>2016-01-28 00:55:58 -0800
commite927ff16661e7b5bd42cba2aa3f1bd3d4ac148ff (patch)
tree9579a5ef8c22e653209cf33d2a6e5069f1a53693 /audio/out/ao_wasapi_utils.c
parentf1072be3b795b1ca360be62cb22581250cd2d6d3 (diff)
downloadmpv-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_utils.c')
-rw-r--r--audio/out/ao_wasapi_utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c
index 842b7fd9e2..9ca72318ad 100644
--- a/audio/out/ao_wasapi_utils.c
+++ b/audio/out/ao_wasapi_utils.c
@@ -858,14 +858,19 @@ static LPWSTR select_device(struct mp_log *l, struct device_desc *d)
(wcslen(d->deviceID) + 1) * sizeof(wchar_t));
}
-LPWSTR find_deviceID(struct ao *ao)
+bstr wasapi_get_specified_device_string(struct ao *ao)
{
- LPWSTR deviceID = NULL;
struct wasapi_state *state = ao->priv;
bstr device = bstr_strip(bstr0(state->opt_device));
if (!device.len)
device = bstr_strip(bstr0(ao->device));
+ return device;
+}
+LPWSTR find_deviceID(struct ao *ao)
+{
+ LPWSTR deviceID = NULL;
+ bstr device = wasapi_get_specified_device_string(ao);
MP_DBG(ao, "Find device \'%.*s\'\n", BSTR_P(device));
struct device_desc *d = NULL;