|
@@ -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){
|