diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2015-12-29 03:13:52 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2016-01-04 07:41:21 -0800 |
commit | cb8b0cc329fa8db3590682afc8c25bb00666843c (patch) | |
tree | 05ed349d5cd37cfa64108557987d979c1c352317 /audio/out/ao_wasapi_changenotify.c | |
parent | 029e31f1c57edae9a70c883342a1214be02fefe4 (diff) | |
download | mpv-cb8b0cc329fa8db3590682afc8c25bb00666843c.tar.bz2 mpv-cb8b0cc329fa8db3590682afc8c25bb00666843c.tar.xz |
ao_wasapi: just use a pointer to the deviceID in change_notify
Rather than creating a new string from the device instance. This will allow
moving the change_init to the main thread before the device is loaded.
Diffstat (limited to 'audio/out/ao_wasapi_changenotify.c')
-rwxr-xr-x | audio/out/ao_wasapi_changenotify.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c index acf0b45ec7..61d70161c5 100755 --- a/audio/out/ao_wasapi_changenotify.c +++ b/audio/out/ao_wasapi_changenotify.c @@ -226,8 +226,7 @@ HRESULT wasapi_change_init(struct ao *ao, bool is_hotplug) MP_DBG(ao, "Monitoring for hotplug events\n"); } else { // Get the device string to compare with the pwstrDeviceId - hr = IMMDevice_GetId(state->pDevice, &change->monitored); - EXIT_ON_ERROR(hr); + change->monitored = state->deviceID; MP_VERBOSE(ao, "Monitoring changes in device %S\n", change->monitored); } @@ -249,6 +248,5 @@ void wasapi_change_uninit(struct ao *ao) change->pEnumerator, (IMMNotificationClient *)change); } - if (change->monitored) CoTaskMemFree(change->monitored); SAFE_RELEASE(change->pEnumerator, IMMDeviceEnumerator_Release(change->pEnumerator)); } |