aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-11-24 14:44:13 -0800
committerChris Robinson <[email protected]>2020-11-24 14:44:13 -0800
commitba39c622efc2bd0e832c0573748fec47bcc3bd6c (patch)
tree23474e7b644e8a6a83940cec7ea3eecaa995ba91 /alc
parenta913aa6ba86db006a42f12781c0bbf9faa6d9b4e (diff)
Disable buffer allocation with CoreAudio capture
Diffstat (limited to 'alc')
-rw-r--r--alc/backends/coreaudio.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp
index 9f674389..3a56c25f 100644
--- a/alc/backends/coreaudio.cpp
+++ b/alc/backends/coreaudio.cpp
@@ -464,6 +464,14 @@ void CoreAudioCapture::open(const ALCchar *name)
if(err != noErr)
throw al::backend_exception{ALC_INVALID_VALUE, "Could not set capture callback: %u", err};
+ // Disable buffer allocation for capture
+ Uint32 flag{0};
+ err = AudioUnitSetProperty(mAudioUnit, kAudioUnitProperty_ShouldAllocateBuffer,
+ kAudioUnitScope_Output, 1, &flag, sizeof(flag));
+ if(err != noErr)
+ throw al::backend_exception{ALC_INVALID_VALUE,
+ "Could not disable buffer allocation property: %u", err};
+
// Initialize the device
err = AudioUnitInitialize(mAudioUnit);
if(err != noErr)