清除无效代码

This commit is contained in:
bluesea 2024-03-11 17:08:11 +08:00
parent f9cd80af4b
commit 7632ba3312

View File

@ -683,21 +683,12 @@ extension VRVideoTransformController {
writer.add(writerInput) writer.add(writerInput)
guard let assetExportSession = exportSession as? AVAssetExportSession else { exportSession.videoComposition = AVMutableVideoComposition(propertiesOf: composition)
print("Failed to cast export session to AVAssetExportSession") exportSession.outputFileType = AVFileType.mov
DispatchQueue.main.async { exportSession.outputURL = outputURL
SVProgressHUD.showInfo(withStatus: "视频转码失败")
}
completion(nil)
return
}
assetExportSession.videoComposition = AVMutableVideoComposition(propertiesOf: composition) exportSession.exportAsynchronously { [self] in
assetExportSession.outputFileType = AVFileType.mov switch exportSession.status {
assetExportSession.outputURL = outputURL
assetExportSession.exportAsynchronously { [self] in
switch assetExportSession.status {
case .completed: case .completed:
let exportedAsset = AVAsset(url: outputURL) let exportedAsset = AVAsset(url: outputURL)
DispatchQueue.main.async { DispatchQueue.main.async {
@ -705,7 +696,7 @@ extension VRVideoTransformController {
completion(exportedAsset) completion(exportedAsset)
} }
case .failed: case .failed:
if let error = assetExportSession.error { if let error = exportSession.error {
print("Export failed with error: \(error.localizedDescription)") print("Export failed with error: \(error.localizedDescription)")
DispatchQueue.main.async { DispatchQueue.main.async {
SVProgressHUD.showInfo(withStatus: "视频导出失败:\(error.localizedDescription)") SVProgressHUD.showInfo(withStatus: "视频导出失败:\(error.localizedDescription)")