13
0

Vapor: improve backwards compat of Apple renderer

replace constants only available >= macOS 11.0
This commit is contained in:
Robin Gareus 2024-02-13 06:29:56 +01:00
parent e13047a769
commit ef81f3163d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -173,24 +173,26 @@ SurroundReturn::SurroundReturn (Session& s, Route* r)
} }
UInt32 renderingAlgorithm = 7; // kSpatializationAlgorithm_UseOutputType; UInt32 renderingAlgorithm = 7; // kSpatializationAlgorithm_UseOutputType;
err = AudioUnitSetProperty (_au,
kAudioUnitProperty_SpatializationAlgorithm, err = AudioUnitSetProperty (_au,
kAudioUnitScope_Input, 19 /*kAudioUnitProperty_SpatializationAlgorithm*/,
0, kAudioUnitScope_Input,
&renderingAlgorithm, 0,
sizeof (renderingAlgorithm)); &renderingAlgorithm,
sizeof (renderingAlgorithm));
if (err != noErr) { if (err != noErr) {
return; return;
} }
UInt32 sourceMode = kSpatialMixerSourceMode_AmbienceBed; UInt32 sourceMode = 3; // kSpatialMixerSourceMode_AmbienceBed;
err = AudioUnitSetProperty (_au,
kAudioUnitProperty_SpatialMixerSourceMode, err = AudioUnitSetProperty (_au,
kAudioUnitScope_Input, 3005 /*kAudioUnitProperty_SpatialMixerSourceMode*/,
0, kAudioUnitScope_Input,
&sourceMode, 0,
sizeof (sourceMode)); &sourceMode,
sizeof (sourceMode));
if (err != noErr) { if (err != noErr) {
return; return;
@ -199,11 +201,12 @@ SurroundReturn::SurroundReturn (Session& s, Route* r)
AURenderCallbackStruct renderCallbackInfo; AURenderCallbackStruct renderCallbackInfo;
renderCallbackInfo.inputProc = _render_callback; renderCallbackInfo.inputProc = _render_callback;
renderCallbackInfo.inputProcRefCon = this; renderCallbackInfo.inputProcRefCon = this;
err = AudioUnitSetProperty (_au,
kAudioUnitProperty_SetRenderCallback, err = AudioUnitSetProperty (_au,
kAudioUnitScope_Input, kAudioUnitProperty_SetRenderCallback,
0, (void*)&renderCallbackInfo, kAudioUnitScope_Input,
sizeof (renderCallbackInfo)); 0, (void*)&renderCallbackInfo,
sizeof (renderCallbackInfo));
if (err != noErr) { if (err != noErr) {
return; return;