release pooled memory while extracting frames

This commit is contained in:
leminlimez committed 2025-06-21 14:15:00 -04:00
1 parent 7bf227a6de
commit bfaf9d1678
1 file changed
+2
@@ -140,6 +140,7 @@ class VideoHandler {
while let sampleBuffer = readerOutput.copyNextSampleBuffer(), while let sampleBuffer = readerOutput.copyNextSampleBuffer(),
let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) { let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) {
try? autoreleasepool {
let name = "\(frameCount).jpg" let name = "\(frameCount).jpg"
let filePathName = "assets/\(name)" let filePathName = "assets/\(name)"
UIApplication.shared.change(title: NSLocalizedString("Generating Video...", comment: ""), body: String(format: NSLocalizedString("Creating %@...", comment: "the message for the current image that is being generated"), filePathName)) UIApplication.shared.change(title: NSLocalizedString("Generating Video...", comment: ""), body: String(format: NSLocalizedString("Creating %@...", comment: "the message for the current image that is being generated"), filePathName))
@@ -154,6 +155,7 @@ class VideoHandler {
} }
} }
} }
}
} catch { } catch {
print("Error reading asset: \(error)") print("Error reading asset: \(error)")