Skip to content

Commit

Permalink
Merge pull request #8 from kolyasev/master
Browse files Browse the repository at this point in the history
Fix deadlock in SCRecordSession
  • Loading branch information
kolyasev authored Jan 15, 2020
2 parents b9e40d6 + 490f392 commit 017f036
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Library/Sources/SCRecordSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,9 @@ - (BOOL)endSegmentWithInfo:(NSDictionary *)info completionHandler:(void(^)(SCRec
[writer endSessionAtSourceTime:CMTimeAdd(_currentSegmentDuration, _sessionStartTime)];

[writer finishWritingWithCompletionHandler: ^{
[self appendRecordSegmentUrl:writer.outputURL info:info error:writer.error completionHandler:completionHandler];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self appendRecordSegmentUrl:writer.outputURL info:info error:writer.error completionHandler:completionHandler];
});
}];
}
} else {
Expand Down

0 comments on commit 017f036

Please sign in to comment.