Преглед изворни кода

1,修改 LOG 2,使用 BASE_FILTER_TIMESCALE

jsonwang пре 3 година
родитељ
комит
84c424994f
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      BFFramework/Classes/PQGPUImage/akfilters/PQMovieInput.swift

+ 6 - 4
BFFramework/Classes/PQGPUImage/akfilters/PQMovieInput.swift

@@ -210,15 +210,17 @@ public class PQMovieInput: ImageSource {
  
  
         autoreleasepool {
-            let duration = Double(Int(CMTimeGetSeconds(playeTimeRange.end) * 1000_000_000)) / 1000_000_000.0 // Only used for the progress block so its acuracy is not critical
-            self.currentTime = CMTimeMakeWithSeconds(self.beginTime +  CMTimeGetSeconds(startTime ?? CMTime.zero), preferredTimescale: 1000_000_000)
+      
+            let duration = CMTimeGetSeconds(playeTimeRange.end)
+            
+            self.currentTime = CMTimeMakeWithSeconds(self.beginTime +  CMTimeGetSeconds(startTime ?? CMTime.zero), preferredTimescale: BASE_FILTER_TIMESCALE)
             self.beginTime = self.beginTime + 1 / 30
             
             let currTime = CMTimeGetSeconds(self.currentTime)
   
             let prgressValue = currTime / Float64(duration)
             
-            FilterLog(message: "\(mIsExport) MovieOutput total frames appended:播放进行中 总用时: \(CFAbsoluteTimeGetCurrent() - (debugStartTime ?? 0.0)) 播放器开始时间:\(CMTimeGetSeconds(playeTimeRange.start)) 播放器原始结束时间:\(CMTimeGetSeconds(playeTimeRange.end))  播放器高精度结束时间:\(duration)  总时间:\(CMTimeGetSeconds(playeTimeRange.end) - CMTimeGetSeconds(playeTimeRange.start)) 播放进度当前时间:\(currTime) 进度:\(prgressValue) 帧id \(totalFramesSent)")
+            FilterLog(message: "\(mIsExport) MovieOutput total frames appended:播放进行中 总用时: \(CFAbsoluteTimeGetCurrent() - (debugStartTime ?? 0.0)) 播放器开始时间:\(CMTimeGetSeconds(playeTimeRange.start)) 播放器原始结束时间:\(CMTimeGetSeconds(playeTimeRange.end))    总时间:\(CMTimeGetSeconds(playeTimeRange.end) - CMTimeGetSeconds(playeTimeRange.start)) 播放进度当前时间:\(currTime) 进度:\(prgressValue) 帧id \(totalFramesSent)")
             totalFramesSent += 1
     
             FilterLog(message: "播放进行中 总用时: \(CFAbsoluteTimeGetCurrent() - (debugStartTime ?? 0.0)) 播放进度当前时间:\(currTime) 进度:\(prgressValue)")
@@ -228,7 +230,7 @@ public class PQMovieInput: ImageSource {
                 self.completion?()
  
                 self.beginTime = 0
-                self.currentTime =  CMTimeMakeWithSeconds(CMTimeGetSeconds(playeTimeRange.start), preferredTimescale: 1000_000_000)
+                self.currentTime =  CMTimeMakeWithSeconds(CMTimeGetSeconds(playeTimeRange.start), preferredTimescale: BASE_FILTER_TIMESCALE)
                 self.isPlay = false
                 self.mAutoPause = true