use linphone_core_create_call_params() instead of making a copy of current params.

This commit is contained in:
Simon Morlat 2016-08-12 10:27:33 +02:00
parent f0f3202acf
commit 6cb3a41187
3 changed files with 13 additions and 13 deletions

View file

@ -601,9 +601,9 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
onCancelClick:^() {
LOGI(@"User declined video proposal");
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_core_accept_call_update(LC, call, paramsCopy);
linphone_call_params_destroy(paramsCopy);
LinphoneCallParams *params = linphone_core_create_call_params(LC,call);
linphone_core_accept_call_update(LC, call, params);
linphone_call_params_destroy(params);
[videoDismissTimer invalidate];
videoDismissTimer = nil;
}
@ -611,10 +611,10 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
onConfirmationClick:^() {
LOGI(@"User accept video proposal");
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_enable_video(paramsCopy, TRUE);
linphone_core_accept_call_update(LC, call, paramsCopy);
linphone_call_params_destroy(paramsCopy);
LinphoneCallParams *params = linphone_core_create_call_params(LC,call);
linphone_call_params_enable_video(params, TRUE);
linphone_core_accept_call_update(LC, call, params);
linphone_call_params_destroy(params);
[videoDismissTimer invalidate];
videoDismissTimer = nil;
}

View file

@ -45,7 +45,7 @@ INIT_WITH_COMMON_CF {
LinphoneCallAppData *callAppData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call);
callAppData->videoRequested =
TRUE; /* will be used later to notify user if video was not activated because of the linphone core*/
LinphoneCallParams *call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
LinphoneCallParams *call_params = linphone_core_create_call_params(LC,call);
linphone_call_params_enable_video(call_params, TRUE);
linphone_core_update_call(LC, call, call_params);
linphone_call_params_destroy(call_params);
@ -64,7 +64,7 @@ INIT_WITH_COMMON_CF {
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call) {
LinphoneCallParams *call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
LinphoneCallParams *call_params = linphone_core_create_call_params(LC,call);
linphone_call_params_enable_video(call_params, FALSE);
linphone_core_update_call(LC, call, call_params);
linphone_call_params_destroy(call_params);

View file

@ -696,11 +696,11 @@ static RootViewManager *rootViewManagerInstance = nil;
[sheet
addDestructiveButtonWithTitle:NSLocalizedString(@"Stop video", nil)
block:^() {
LinphoneCallParams *paramsCopy =
linphone_call_params_copy(linphone_call_get_current_params(call));
LinphoneCallParams *params =
linphone_core_create_call_params(LC,call);
// stop video
linphone_call_params_enable_video(paramsCopy, FALSE);
linphone_core_update_call(LC, call, paramsCopy);
linphone_call_params_enable_video(params, FALSE);
linphone_core_update_call(LC, call, params);
}];
[sheet showInView:self.view];
callData->batteryWarningShown = TRUE;