From 3f28b6b376aabf466e922c9d15d779d1440789e5 Mon Sep 17 00:00:00 2001 From: Tomotaka Yoshimura Date: Sat, 24 Sep 2022 13:24:39 +0900 Subject: [PATCH] Fix an issue that iPhone 13 Pro will playback at a high speed when looping --- FLAnimatedImage/FLAnimatedImageView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FLAnimatedImage/FLAnimatedImageView.m b/FLAnimatedImage/FLAnimatedImageView.m index 34178ef..801e806 100755 --- a/FLAnimatedImage/FLAnimatedImageView.m +++ b/FLAnimatedImage/FLAnimatedImageView.m @@ -398,7 +398,7 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink } if (@available(iOS 10, *)) { - self.accumulator += displayLink.targetTimestamp - CACurrentMediaTime(); + self.accumulator += ((NSTimeInterval)1)/((NSTimeInterval)displayLink.preferredFramesPerSecond); } else { self.accumulator += displayLink.duration * (NSTimeInterval)displayLink.frameInterval; }