File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,10 @@ public class UpscalingExportSession {
383383 while assetWriterInput. isReadyForMoreMediaData {
384384 if let nextSampleBuffer = assetReaderOutput. copyNextSampleBuffer ( ) {
385385 if nextSampleBuffer. presentationTimeStamp. isNumeric {
386- progress. completedUnitCount = Int64 ( nextSampleBuffer. presentationTimeStamp. seconds)
386+ let timestamp = Int64 ( nextSampleBuffer. presentationTimeStamp. seconds)
387+ DispatchQueue . main. async {
388+ progress. completedUnitCount = timestamp
389+ }
387390 }
388391 if let imageBuffer = nextSampleBuffer. imageBuffer {
389392 let upscaledImageBuffer = upscaler. upscale (
@@ -433,7 +436,10 @@ public class UpscalingExportSession {
433436 while assetWriterInput. isReadyForMoreMediaData {
434437 if let nextSampleBuffer = assetReaderOutput. copyNextSampleBuffer ( ) {
435438 if nextSampleBuffer. presentationTimeStamp. isNumeric {
436- progress. completedUnitCount = Int64 ( nextSampleBuffer. presentationTimeStamp. seconds)
439+ let timestamp = Int64 ( nextSampleBuffer. presentationTimeStamp. seconds)
440+ DispatchQueue . main. async {
441+ progress. completedUnitCount = timestamp
442+ }
437443 }
438444 if let taggedBuffers = nextSampleBuffer. taggedBuffers {
439445 let leftEyeBuffer = taggedBuffers. first ( where: {
You can’t perform that action at this time.
0 commit comments