summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi_changenotify.c
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2017-01-29 23:59:24 +1100
committerJames Ross-Gowan <rossymiles@gmail.com>2017-01-30 00:22:30 +1100
commit9692814502223574b575931d32ddd458b9476bb6 (patch)
tree8a86cb132d6b03e46a28fa18218be1da20607ea6 /audio/out/ao_wasapi_changenotify.c
parenta6d29494ca6e45b66570deda99c2eef79f72d16c (diff)
downloadmpv-9692814502223574b575931d32ddd458b9476bb6.tar.bz2
mpv-9692814502223574b575931d32ddd458b9476bb6.tar.xz
win32: add COM-specific SAFE_RELEASE to windows_utils.h
See: https://msdn.microsoft.com/en-us/library/windows/desktop/dd743946.aspx Microsoft example code often uses a SAFE_RELEASE macro like the one in the above link. This makes it easier to avoid errors when releasing COM interfaces. It also reduces noise in COM-heavy code. ao_wasapi.h also had a macro called SAFE_RELEASE, though unlike the version above, its SAFE_RELEASE macro accepted a second parameter which allowed it to destroy arbitrary objects other than just COM interfaces. This renames ao_wasapi's SAFE_RELEASE to SAFE_DESTROY, which should more accurately reflect what it does and prevent confusion with the Microsoft version.
Diffstat (limited to 'audio/out/ao_wasapi_changenotify.c')
-rw-r--r--audio/out/ao_wasapi_changenotify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c
index e1b3a9d604..b9806e0adb 100644
--- a/audio/out/ao_wasapi_changenotify.c
+++ b/audio/out/ao_wasapi_changenotify.c
@@ -242,5 +242,5 @@ void wasapi_change_uninit(struct ao *ao)
change->pEnumerator, (IMMNotificationClient *)change);
}
- SAFE_RELEASE(change->pEnumerator, IMMDeviceEnumerator_Release(change->pEnumerator));
+ SAFE_RELEASE(change->pEnumerator);
}