Fix crash which occur sometimes on the add of video

This commit is contained in:
Erwan Croze 2017-01-27 15:30:10 +01:00
parent 4ce4a2a869
commit 885cc3c59f

View file

@ -127,7 +127,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
private LinphoneCoreListenerBase mListener; private LinphoneCoreListenerBase mListener;
private DrawerLayout sideMenu; private DrawerLayout sideMenu;
private boolean mProximitySensingEnabled; private boolean mProximitySensingEnabled;
private Handler mHandler = new Handler(); private Handler mHandler = new Handler();
private Timer mTimer; private Timer mTimer;
private TimerTask mTask; private TimerTask mTask;
@ -763,7 +763,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
LinphoneManager.getLc().updateCall(call, params); LinphoneManager.getLc().updateCall(call, params);
} else { } else {
videoProgress.setVisibility(View.VISIBLE); videoProgress.setVisibility(View.VISIBLE);
if (!call.getRemoteParams().isLowBandwidthEnabled()) { if (call.getRemoteParams() != null && !call.getRemoteParams().isLowBandwidthEnabled()) {
LinphoneManager.getInstance().addVideo(); LinphoneManager.getInstance().addVideo();
} else { } else {
displayCustomToast(getString(R.string.error_low_bandwidth), Toast.LENGTH_LONG); displayCustomToast(getString(R.string.error_low_bandwidth), Toast.LENGTH_LONG);
@ -1651,7 +1651,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
getString(R.string.call_stats_video_resolution_received), getString(R.string.call_stats_video_resolution_received),
"\u2193 " + params.getReceivedVideoSize().toDisplayableString()); "\u2193 " + params.getReceivedVideoSize().toDisplayableString());
} else { } else {
formatText(jitterBuffer, getString(R.string.call_stats_jitter_buffer), formatText(jitterBuffer, getString(R.string.call_stats_jitter_buffer),
new DecimalFormat("##.##").format(stats.getJitterBufferSize()) + " ms"); new DecimalFormat("##.##").format(stats.getJitterBufferSize()) + " ms");
} }
} else { } else {