Merge pull request #3286 from kinarobin/add-tvos-check-in-target-time-stamp

Add tvos check when use `targetTimestamp` in displaylink
This commit is contained in:
Kinarobin 2021-10-09 17:48:36 +08:00 committed by GitHub
commit 0b59464d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSTimeInterval duration = 0;
if (@available(iOS 10.0, *)) {
if (@available(iOS 10.0, tvOS 10.0, *)) {
duration = self.displayLink.targetTimestamp - CACurrentMediaTime();
} else {
duration = self.displayLink.duration * self.displayLink.frameInterval;