|
@@ -131,7 +131,7 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
|
|
|
FilterLog(message: "设置线程为: \(Thread.current) \(OperationQueue.current?.underlyingQueue?.label as Any)")
|
|
|
|
|
|
- configCache()
|
|
|
+ configCache(beginTime: mStickers?.first?.timelineIn ?? 0)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -406,7 +406,7 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
guard let strongSelf = self else { return }
|
|
|
|
|
|
if(strongSelf.filters.count == 0){
|
|
|
- strongSelf.configCache()
|
|
|
+ strongSelf.configCache(beginTime: strongSelf.mStickers?.first?.timelineIn ?? 0)
|
|
|
}
|
|
|
|
|
|
DispatchQueue.main.async {
|
|
@@ -421,8 +421,9 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
applyFilters()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- func configCache() {
|
|
|
+
|
|
|
+
|
|
|
+ func configCache(beginTime: Float64 ) {
|
|
|
cacheFilters.removeAll()
|
|
|
FilterLog(message: "原素材 总数:\(mStickers?.count ?? 0) ")
|
|
|
|
|
@@ -435,9 +436,13 @@ public class PQGPUImagePlayerView: UIView {
|
|
|
|
|
|
for (index, currentSticker) in mStickers!.enumerated() {
|
|
|
|
|
|
- if index == cacheFiltersMaxCount {
|
|
|
+ if cacheFilters.count == cacheFiltersMaxCount {
|
|
|
break
|
|
|
}
|
|
|
+
|
|
|
+ if(currentSticker.timelineOut < beginTime){
|
|
|
+ continue
|
|
|
+ }
|
|
|
var showFitler: PQBaseFilter?
|
|
|
if currentSticker.type == StickerType.VIDEO.rawValue {
|
|
|
showFitler = PQMovieFilter(movieSticker: currentSticker)
|