stop时crash finishWritingWithCompletionHandler
tailangjun opened this issue · 2 comments
tailangjun commented
crash必现,即使在前面加上markAsFinished还是crash
dispatch_async(_dispatchQueue, ^{
[_videoWriterInput markAsFinished];
[_audioWriterInput markAsFinished];
[_assetWriter finishWritingWithCompletionHandler:^{
tailangjun commented
知道原因了,是重复调用stop,在前清空即可
dispatch_async(_dispatchQueue, ^{
[_videoWriterInput markAsFinished];
[_audioWriterInput markAsFinished];
[_assetWriter finishWritingWithCompletionHandler:^{
if (_assetWriter.status == AVAssetWriterStatusCompleted) {
dispatch_async(dispatch_get_main_queue(), ^{
if ([_delegate respondsToSelector:@selector(videoWriter:didOutputVideoAtPath:)]) {
[_delegate videoWriter:self didOutputVideoAtPath:_assetWriter.outputURL];
}
});
}
}];
_assetWriter = nil;
});
Damonvvong commented
好的。我关闭了