From 7fc3fdffbe52a25bc75ed1ed03ff11720701439f Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 28 Apr 2015 11:17:48 +0200 Subject: [PATCH] WizardViewController.m: avoid hanging for 10 secs when clicking any button on iPad due to video preview reset (#1930) --- Classes/WizardViewController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index abf0531e0..2f2c2fd4e 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -624,7 +624,13 @@ static UICompositeViewDescription *compositeDescription = nil; NSString* fullPath = [@"file://" stringByAppendingString:[LinphoneManager bundleFile:rcFilename]]; linphone_core_set_provisioning_uri([LinphoneManager getLc], [fullPath cStringUsingEncoding:[NSString defaultCStringEncoding]]); [[LinphoneManager instance] lpConfigSetInt:1 forKey:@"transient_provisioning" forSection:@"misc"]; + + // For some reason, video preview hangs for 15seconds when resetting linphone core from here... + // to avoid it, we disable it before and reenable it after core restart. + BOOL hasPreview = linphone_core_video_preview_enabled([LinphoneManager getLc]); + linphone_core_enable_video_preview([LinphoneManager getLc], FALSE); [[LinphoneManager instance] resetLinphoneCore]; + linphone_core_enable_video_preview([LinphoneManager getLc], hasPreview); } #pragma mark - UITextFieldDelegate Functions