Video Stickers Fixes

This commit is contained in:
Ilya Laktyushin 2022-01-27 17:56:25 +03:00
parent bbc082e991
commit 1e2695839a
8 changed files with 58 additions and 47 deletions

View file

@ -299,13 +299,13 @@ final class VideoStickerDirectFrameSource: AnimatedStickerFrameSource {
self.height = height
self.bytesPerRow = DeviceGraphicsContextSettings.shared.bytesPerRow(forWidth: Int(self.width))
self.currentFrame = 0
self.cache = cachePathPrefix.flatMap { cachePathPrefix in
VideoStickerFrameSourceCache(queue: queue, pathPrefix: cachePathPrefix, width: width, height: height)
}
self.source = SoftwareVideoSource(path: path, hintVP9: true)
self.frameRate = self.source.getFramerate()
self.frameRate = min(30, self.source.getFramerate())
self.frameCount = (self.cache?.frameCount).flatMap { Int($0) } ?? 0
}