Explorar o código

Merge branch 'master' of https://git.yishihui.com/iOS/BFFramework

* 'master' of https://git.yishihui.com/iOS/BFFramework:
  图片+视频 前面黑屏问题
  容错判断
huzhiqiang %!s(int64=3) %!d(string=hai) anos
pai
achega
39625749c3

+ 11 - 5
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -1219,13 +1219,13 @@ extension PQStuckPointEditerController {
                                 }
                                 totalClipNum = totalClipNum + sticker.clipCount
                             } else if sticker.type == StickerType.IMAGE.rawValue {
-                                if totalClipNum + 2 >= finallyStuckPoints.count {
+                                if totalClipNum + 1 >= finallyStuckPoints.count {
                                     BFLog(message: "数据出现错误!!!查正") // 155.318253
                                     break
                                 }
                                 sticker.generateDefaultValues()
-                                sticker.timelineIn = Float64(finallyStuckPoints[totalClipNum + 1])
-                                sticker.timelineOut = Float64(finallyStuckPoints[totalClipNum + 2])
+                                sticker.timelineIn = Float64(finallyStuckPoints[totalClipNum])
+                                sticker.timelineOut = Float64(finallyStuckPoints[totalClipNum + 1])
                                 totalClipNum = totalClipNum + 1
                                 stickers.append(sticker)
                                 BFLog(message: "测试人员创建 sticker  crilp is in 图片 \(String(format: "%.6f", sticker.model_in))  out  \(String(format: "%.6f", sticker.out)) ,分段素材时长:\(String(format: "%.6f", (sticker.out) - (sticker.model_in))) ,分段显示时长:\(String(format: "%.6f", (sticker.timelineOut) - (sticker.timelineIn))),   timelineIN: \(String(format: "%.6f", sticker.timelineIn)) timelineOUT:\(String(format: "%.6f", sticker.timelineOut)) speedRate:\(sticker.speedRate)")
@@ -1302,7 +1302,10 @@ extension PQStuckPointEditerController {
 
     func clipPoint(clipCount: Int, oldPoints: Array<Float>) {
         BFLog(message: "拼接卡点数:\(clipCount)")
-
+        if(clipCount < 0){
+            BFLog(message: "clipCount is error!!!! \(clipCount)")
+            return
+        }
         // 如果是第一次拼接先补第0位
         if finallyStuckPoints.count == 0 {
             finallyStuckPoints.append(stuckPointsTemp.first ?? 0.0)
@@ -1512,7 +1515,10 @@ extension PQStuckPointEditerController {
             // lastCyclesSelectIndex != -1 已经设置过循环次数 应该是手动设置的值
             if lastCyclesSelectIndex != -1 {
                 // 纯图片时 已经默认添加一次循环 所以要用lastCyclesSelectIndex - 1
-                clipPoint(clipCount: selectedImageDataCount * lastCyclesSelectIndex - 1, oldPoints: stuckPointsTemp)
+                if(lastCyclesSelectIndex != 0){
+                    clipPoint(clipCount: selectedImageDataCount * lastCyclesSelectIndex - 1, oldPoints: stuckPointsTemp)
+                }
+           
 
             } else {
                 lastCyclesSelectIndex = 0