Fix crash on second invocation of camera when running on iOS 10 simulator (#441)

This commit is contained in:
Ian Bussières 2016-11-18 17:45:21 -05:00 committed by Nicolas Charpentier
parent 6fe07c48ae
commit 3f04dd3587
1 changed files with 8 additions and 6 deletions

View File

@ -995,13 +995,15 @@ didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL
- (void)setCaptureQuality:(NSString *)quality
{
if (quality) {
[self.session beginConfiguration];
if ([self.session canSetSessionPreset:quality]) {
self.session.sessionPreset = quality;
#if !(TARGET_IPHONE_SIMULATOR)
if (quality) {
[self.session beginConfiguration];
if ([self.session canSetSessionPreset:quality]) {
self.session.sessionPreset = quality;
}
[self.session commitConfiguration];
}
[self.session commitConfiguration];
}
#endif
}
@end