From f008b5a7cb34ad09cc3267ded8d0d3cb6dbe3d34 Mon Sep 17 00:00:00 2001 From: Alex Chronopoulos Date: Thu, 21 Apr 2016 21:03:45 +0300 Subject: [PATCH] Allow NULL callback for deregister --- src/cubeb.c | 2 +- src/cubeb_audiounit.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cubeb.c b/src/cubeb.c index 266b41e..9b5ba02 100644 --- a/src/cubeb.c +++ b/src/cubeb.c @@ -384,7 +384,7 @@ int cubeb_stream_device_destroy(cubeb_stream * stream, int cubeb_stream_register_device_changed_callback(cubeb_stream * stream, cubeb_device_changed_callback device_changed_callback) { - if (!stream || !device_changed_callback) { + if (!stream) { return CUBEB_ERROR_INVALID_PARAMETER; } diff --git a/src/cubeb_audiounit.c b/src/cubeb_audiounit.c index e8c468d..4f8b98e 100644 --- a/src/cubeb_audiounit.c +++ b/src/cubeb_audiounit.c @@ -479,8 +479,10 @@ audiounit_add_listener(cubeb_stream * stm, AudioDeviceID id, AudioObjectProperty } OSStatus -audiounit_remove_listener(cubeb_stream * stm, AudioDeviceID id, AudioObjectPropertySelector selector, - AudioObjectPropertyScope scope, AudioObjectPropertyListenerProc listener) +audiounit_remove_listener(cubeb_stream * stm, AudioDeviceID id, + AudioObjectPropertySelector selector, + AudioObjectPropertyScope scope, + AudioObjectPropertyListenerProc listener) { AudioObjectPropertyAddress address = { selector,