|
@@ -320,13 +320,18 @@ public class PQMovieInput: ImageSource {
|
|
|
mIsExport = isExport
|
|
|
do {
|
|
|
try NSObject.catchException { [self] in
|
|
|
-// guard self.assetReader.startReading() else {
|
|
|
-// FilterLog(message: "ERROR: Unable to start reading: \(String(describing: self.assetReader.error))")
|
|
|
-// return
|
|
|
-// }
|
|
|
- if !mAutoPause {
|
|
|
- avplayerMusic()
|
|
|
+ if(mIsExport){
|
|
|
+ guard self.assetReader.startReading() else {
|
|
|
+ FilterLog(message: "ERROR: Unable to start reading: \(String(describing: self.assetReader.error))")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if !mAutoPause {
|
|
|
+ avplayerMusic()
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
} catch {
|
|
|
FilterLog(message: "ERROR: Unable to start reading: \(error)")
|
|
@@ -484,7 +489,11 @@ public class PQMovieInput: ImageSource {
|
|
|
|
|
|
func readNextAudioSample(with assetReader: AVAssetReader, from audioTrackOutput: AVAssetReaderOutput) {
|
|
|
|
|
|
- return
|
|
|
+ if(!mIsExport){
|
|
|
+ FilterLog(message: "不是导出模式")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if !isPlay {
|
|
|
FilterLog(message: "自动停到首帧的不处理音频")
|
|
|
return
|
|
@@ -727,7 +736,7 @@ extension PQMovieInput {
|
|
|
}
|
|
|
|
|
|
func avPlayerPlayComplete(){
|
|
|
- self.avPlayer!.pause()
|
|
|
+ self.avPlayer?.pause()
|
|
|
self.indexRage = 0
|
|
|
let playerItem = self.avPlayer?.currentItem
|
|
|
playerItem?.seek(to: playerItem?.reversePlaybackEndTime ?? CMTime(value: 0, timescale: 40))
|