Hack the first frame to ensure it always displayed in first screen refresh

This commit is contained in:
DreamPiggy 2022-12-26 19:05:39 +08:00
parent b5db7fac68
commit 717461459f
1 changed files with 2 additions and 0 deletions

View File

@ -152,6 +152,8 @@
UIImage *posterFrame = [[UIImage alloc] initWithCGImage:image.CGImage scale:image.scale orientation:image.imageOrientation]; UIImage *posterFrame = [[UIImage alloc] initWithCGImage:image.CGImage scale:image.scale orientation:image.imageOrientation];
#endif #endif
if (posterFrame) { if (posterFrame) {
// HACK: The first frame should not check duration and immediately display
self.needsDisplayWhenImageBecomesAvailable = YES;
SD_LOCK(self->_lock); SD_LOCK(self->_lock);
self.frameBuffer[@(self.currentFrameIndex)] = posterFrame; self.frameBuffer[@(self.currentFrameIndex)] = posterFrame;
SD_UNLOCK(self->_lock); SD_UNLOCK(self->_lock);