Fixed Bluetooth audio output on Apple TV

This commit is contained in:
Sam Lantinga 2020-06-04 12:26:57 -07:00
parent cced5eb937
commit ff53521bc6
1 changed files with 67 additions and 64 deletions

View File

@ -406,11 +406,14 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec
if (category == AVAudioSessionCategoryPlayAndRecord) {
options |= AVAudioSessionCategoryOptionDefaultToSpeaker;
}
#endif
if (category == AVAudioSessionCategoryRecord ||
category == AVAudioSessionCategoryPlayAndRecord) {
options |= AVAudioSessionCategoryOptionAllowBluetooth;
/* AVAudioSessionCategoryOptionAllowBluetooth isn't available in the SDK for
Apple TV but is still needed in order to output to Bluetooth devices.
*/
options |= 0x4; /* AVAudioSessionCategoryOptionAllowBluetooth; */
}
#endif
if (category == AVAudioSessionCategoryPlayAndRecord) {
options |= AVAudioSessionCategoryOptionAllowBluetoothA2DP |
AVAudioSessionCategoryOptionAllowAirPlay;