Prechádzať zdrojové kódy

图片+视频 素材时,切换模式后图片素材丢失问题处理

jsonwang 3 rokov pred
rodič
commit
c94c90294f

+ 1 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -1602,7 +1602,7 @@ extension PQStuckPointEditerController {
             finallyUserAudioTime = Float(finallyStuckPoints.last ?? 0) + (Float(CMTimeGetSeconds(asset.duration)) - Float(lastSecondPoint))
         }
 
-        playeTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Float(finallyStuckPoints.first ?? 0) * Float(BASE_FILTER_TIMESCALE)), timescale: BASE_FILTER_TIMESCALE), end: CMTime(value: CMTimeValue((Float(finallyStuckPoints.last ?? 0)) * Float(BASE_FILTER_TIMESCALE)), timescale: BASE_FILTER_TIMESCALE))
+        playeTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Float64(finallyStuckPoints.first ?? 0) * Float64(BASE_FILTER_TIMESCALE)), timescale: BASE_FILTER_TIMESCALE), end: CMTime(value: CMTimeValue((Float64(finallyStuckPoints.last ?? 0)) * Float64(BASE_FILTER_TIMESCALE)), timescale: BASE_FILTER_TIMESCALE))
 
         for (index, usePoint) in finallyStuckPoints.enumerated() {
             BFLog(message: "测试人员最后使用的卡点信息 \(index) : \(usePoint)")

+ 4 - 3
BFFramework/Classes/Stuckpoint/ViewModel/PQGPUImagePlayerView.swift

@@ -550,17 +550,18 @@ public class PQGPUImagePlayerView: UIView {
     /// - Parameter currTime: 当前播放时间
     func changeFilter(currTime: Float64) {
         let  starts:CFTimeInterval = CFAbsoluteTimeGetCurrent()
-         
         BFLog(message: " 要查找的 currTime is \(currTime)")
         //1,删除已经显示过的 filter
         self.cacheFilters.removeAll(where: {(filter) -> Bool in
 
-            (Int(currTime * 1000) > Int((filter.stickerInfo?.timelineOut ?? 0.0) * 1000))
+            (currTime > (filter.stickerInfo?.timelineOut ?? 0.0))
+
         })
  
         // 2,找出一个要显示的 fitler
         let showIndex = cacheFilters.firstIndex(where: { (filter) -> Bool in
-            (Int(currTime * 1000) >= Int((filter.stickerInfo?.timelineIn ?? 0.0) * 1000) && Int(currTime * 1000) <= Int((filter.stickerInfo?.timelineOut ?? 0.0) * 1000))
+            (currTime >= (filter.stickerInfo?.timelineIn ?? 0.0) && currTime <= (filter.stickerInfo?.timelineOut ?? 0.0))
+
         })
   
         if(showIndex == nil){