Closed donmai-me closed 1 year ago
Interesting, I'm thinking there's probably a way to detect this state change. Anyway good work, I'm merging your PR
Best I can think of is using the display link's targetTimestamp
and timestamp
to get the current display framerate. Like
let actualFramesPerSecond = 1 / (displaylink.targetTimestamp - displaylink.timestamp)
For macOS:
// WARNING: This is divide-by-zero if the display is not available
let actualFramesPerSecond = 1 / CVDisplayLinkGetActualOutputVideoRefreshPeriod(displaylink)
SwiftyGifManager already uses the appropriate display link on macOS and iOS for its timer
. Maybe it can also be used to get the current framerate.
It seems like this change regressed GIF playback on my app.
For some reason, all GIFs play super slow on 120hz iPhones (e.g. 14 pro max).
I had to downgrade to 5.4.3 to fix it.
It seems like this change regressed GIF playback on my app.
For some reason, all GIFs play super slow on 120hz iPhones (e.g. 14 pro max).
I had to downgrade to 5.4.3 to fix it.
I confirm, faced the same problem
Reverted this commit, but seem to cause other issues
Hi! Like I said above this is a bandaid fix. The correct solution would be something like I proposed above; to use the appropriate display link to get the current framerate rather than hardcoding framerates.
Fixes #170 and brings back tvOS support. This is a band aid solution to the problem as the playback speed gets slow when my iPad pro is on low power mode.