Skip to content

Commit

Permalink
FIX: [darwin] the real problem when coming back from sleep on AppleTV…
Browse files Browse the repository at this point in the history
…4/4K
  • Loading branch information
davilla committed Nov 18, 2018
1 parent db8e3ef commit bfc0eb8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xbmc/platform/darwin/DarwinUtils.mm
Expand Up @@ -922,7 +922,16 @@ bool CFStringRefToStringWithEncoding(CFStringRef source, std::string &destinatio
#if defined(TARGET_DARWIN_IOS)
AVAudioSession *myAudioSession = [AVAudioSession sharedInstance];
AVAudioSessionRouteDescription *currentRoute = [myAudioSession currentRoute];
NSString *output = [[currentRoute.outputs objectAtIndex:0] portType];
NSString *output = nullptr;
try
{
// this can thow when coming back from sleep on AppleTV4/4k
output = [[currentRoute.outputs objectAtIndex:0] portType];
}
catch (...)
{
}

if (output)
route = [output UTF8String];
#endif
Expand Down

0 comments on commit bfc0eb8

Please sign in to comment.