iOS9: fix crash fetching refresh rate
This commit is contained in:
parent
9595904af1
commit
dbd5e89149
|
@ -150,7 +150,12 @@ static void *apple_display_server_get_resolution_list(
|
|||
[rates addObjectsFromArray:@[@(24), @(30), @(40), @(48), @(60), @(120)]];
|
||||
else
|
||||
#endif
|
||||
[rates addObject:@(mainScreen.maximumFramesPerSecond)];
|
||||
{
|
||||
if (@available(iOS 10.3, tvOS 10.2, *))
|
||||
[rates addObject:@(mainScreen.maximumFramesPerSecond)];
|
||||
else
|
||||
[rates addObject:@(60)];
|
||||
}
|
||||
#endif
|
||||
|
||||
NSArray *sorted = [[rates allObjects] sortedArrayUsingSelector:@selector(compare:)];
|
||||
|
|
|
@ -242,7 +242,10 @@ static float cocoa_gl_gfx_ctx_get_refresh_rate(void *data)
|
|||
CFRelease(currentMode);
|
||||
return currentRate;
|
||||
#else
|
||||
return [UIScreen mainScreen].maximumFramesPerSecond;
|
||||
if (@available(iOS 10.3, tvOS 10.2, *))
|
||||
return [UIScreen mainScreen].maximumFramesPerSecond;
|
||||
else
|
||||
return 60;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue