Merge pull request #5811 from mfleisz/mac_rdpsnd_workaround

rdpsnd: Do not set output device on Catalina or later (#5747)
This commit is contained in:
Martin Fleisz
2020-01-03 14:47:10 +01:00
committed by GitHub

View File

@@ -167,14 +167,22 @@ static BOOL rdpsnd_mac_open(rdpsndDevicePlugin *device, const AUDIO_FORMAT *form
if (!mac->engine)
return FALSE;
err = AudioUnitSetProperty(mac->engine.outputNode.audioUnit,
kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0,
&outputDeviceID, sizeof(outputDeviceID));
if (err)
if (@available(macOS 10.15, *))
{
rdpsnd_mac_release(mac);
WLog_ERR(TAG, "AudioUnitSetProperty: %s", FormatError(err));
return FALSE;
/* Setting the output audio device on 10.15 or later breaks sound playback. Do not set for
* now until we find a proper fix for #5747 */
}
else
{
err = AudioUnitSetProperty(mac->engine.outputNode.audioUnit,
kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global,
0, &outputDeviceID, sizeof(outputDeviceID));
if (err)
{
rdpsnd_mac_release(mac);
WLog_ERR(TAG, "AudioUnitSetProperty: %s", FormatError(err));
return FALSE;
}
}
mac->player = [[AVAudioPlayerNode alloc] init];