mirror of https://github.com/FreeRDP/FreeRDP
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:
commit
5d804852b5
|
@ -167,14 +167,22 @@ static BOOL rdpsnd_mac_open(rdpsndDevicePlugin *device, const AUDIO_FORMAT *form
|
||||||
if (!mac->engine)
|
if (!mac->engine)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
err = AudioUnitSetProperty(mac->engine.outputNode.audioUnit,
|
if (@available(macOS 10.15, *))
|
||||||
kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0,
|
|
||||||
&outputDeviceID, sizeof(outputDeviceID));
|
|
||||||
if (err)
|
|
||||||
{
|
{
|
||||||
rdpsnd_mac_release(mac);
|
/* Setting the output audio device on 10.15 or later breaks sound playback. Do not set for
|
||||||
WLog_ERR(TAG, "AudioUnitSetProperty: %s", FormatError(err));
|
* now until we find a proper fix for #5747 */
|
||||||
return FALSE;
|
}
|
||||||
|
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];
|
mac->player = [[AVAudioPlayerNode alloc] init];
|
||||||
|
|
Loading…
Reference in New Issue