Re #1509: backported r4122-r4129.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4130 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
48f46a9f37
commit
0663885d34
|
@ -1139,7 +1139,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duration for progressive discard algotithm in jitter buffer to discard
|
* Duration for progressive discard algotithm in jitter buffer to discard
|
||||||
* an excessive frame when burst is equal to or lower than
|
* an excessive frame when burst is equal to or greater than
|
||||||
* PJMEDIA_JBUF_PRO_DISC_MAX_BURST, in milliseconds.
|
* PJMEDIA_JBUF_PRO_DISC_MAX_BURST, in milliseconds.
|
||||||
*
|
*
|
||||||
* Default: 10000 ms
|
* Default: 10000 ms
|
||||||
|
|
|
@ -547,6 +547,7 @@ static pj_status_t open_playback (struct alsa_stream* stream,
|
||||||
int result;
|
int result;
|
||||||
unsigned int rate;
|
unsigned int rate;
|
||||||
snd_pcm_uframes_t tmp_buf_size;
|
snd_pcm_uframes_t tmp_buf_size;
|
||||||
|
snd_pcm_uframes_t tmp_period_size;
|
||||||
|
|
||||||
if (param->play_id < 0 || param->play_id >= stream->af->dev_cnt)
|
if (param->play_id < 0 || param->play_id >= stream->af->dev_cnt)
|
||||||
return PJMEDIA_EAUD_INVDEV;
|
return PJMEDIA_EAUD_INVDEV;
|
||||||
|
@ -613,10 +614,11 @@ static pj_status_t open_playback (struct alsa_stream* stream,
|
||||||
param->channel_count;
|
param->channel_count;
|
||||||
TRACE_((THIS_FILE, "open_playback: set period size: %d",
|
TRACE_((THIS_FILE, "open_playback: set period size: %d",
|
||||||
stream->pb_frames));
|
stream->pb_frames));
|
||||||
|
tmp_period_size = stream->pb_frames;
|
||||||
snd_pcm_hw_params_set_period_size_near (stream->pb_pcm, params,
|
snd_pcm_hw_params_set_period_size_near (stream->pb_pcm, params,
|
||||||
&stream->pb_frames, NULL);
|
&tmp_period_size, NULL);
|
||||||
TRACE_((THIS_FILE, "open_playback: period size set to: %d",
|
TRACE_((THIS_FILE, "open_playback: period size set to: %d",
|
||||||
stream->pb_frames));
|
tmp_period_size));
|
||||||
|
|
||||||
/* Set the sound device buffer size and latency */
|
/* Set the sound device buffer size and latency */
|
||||||
if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY)
|
if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY)
|
||||||
|
@ -663,6 +665,7 @@ static pj_status_t open_capture (struct alsa_stream* stream,
|
||||||
int result;
|
int result;
|
||||||
unsigned int rate;
|
unsigned int rate;
|
||||||
snd_pcm_uframes_t tmp_buf_size;
|
snd_pcm_uframes_t tmp_buf_size;
|
||||||
|
snd_pcm_uframes_t tmp_period_size;
|
||||||
|
|
||||||
if (param->rec_id < 0 || param->rec_id >= stream->af->dev_cnt)
|
if (param->rec_id < 0 || param->rec_id >= stream->af->dev_cnt)
|
||||||
return PJMEDIA_EAUD_INVDEV;
|
return PJMEDIA_EAUD_INVDEV;
|
||||||
|
@ -729,10 +732,11 @@ static pj_status_t open_capture (struct alsa_stream* stream,
|
||||||
param->channel_count;
|
param->channel_count;
|
||||||
TRACE_((THIS_FILE, "open_capture: set period size: %d",
|
TRACE_((THIS_FILE, "open_capture: set period size: %d",
|
||||||
stream->ca_frames));
|
stream->ca_frames));
|
||||||
|
tmp_period_size = stream->ca_frames;
|
||||||
snd_pcm_hw_params_set_period_size_near (stream->ca_pcm, params,
|
snd_pcm_hw_params_set_period_size_near (stream->ca_pcm, params,
|
||||||
&stream->ca_frames, NULL);
|
&tmp_period_size, NULL);
|
||||||
TRACE_((THIS_FILE, "open_capture: period size set to: %d",
|
TRACE_((THIS_FILE, "open_capture: period size set to: %d",
|
||||||
stream->ca_frames));
|
tmp_period_size));
|
||||||
|
|
||||||
/* Set the sound device buffer size and latency */
|
/* Set the sound device buffer size and latency */
|
||||||
if (param->flags & PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY)
|
if (param->flags & PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY)
|
||||||
|
|
|
@ -675,6 +675,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
|
||||||
pjsip_route_hdr local_route;
|
pjsip_route_hdr local_route;
|
||||||
pj_str_t acc_proxy[PJSUA_ACC_MAX_PROXIES];
|
pj_str_t acc_proxy[PJSUA_ACC_MAX_PROXIES];
|
||||||
pj_bool_t update_reg = PJ_FALSE;
|
pj_bool_t update_reg = PJ_FALSE;
|
||||||
|
pj_bool_t unreg_first = PJ_FALSE;
|
||||||
pj_status_t status = PJ_SUCCESS;
|
pj_status_t status = PJ_SUCCESS;
|
||||||
|
|
||||||
PJ_ASSERT_RETURN(acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc),
|
PJ_ASSERT_RETURN(acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc),
|
||||||
|
@ -802,6 +803,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
|
||||||
pj_strdup_with_null(acc->pool, &acc->srv_domain, &id_sip_uri->host);
|
pj_strdup_with_null(acc->pool, &acc->srv_domain, &id_sip_uri->host);
|
||||||
acc->srv_port = 0;
|
acc->srv_port = 0;
|
||||||
update_reg = PJ_TRUE;
|
update_reg = PJ_TRUE;
|
||||||
|
unreg_first = PJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* User data */
|
/* User data */
|
||||||
|
@ -856,6 +858,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
|
||||||
pj_strdup_with_null(acc->pool, &acc->cfg.force_contact,
|
pj_strdup_with_null(acc->pool, &acc->cfg.force_contact,
|
||||||
&cfg->force_contact);
|
&cfg->force_contact);
|
||||||
update_reg = PJ_TRUE;
|
update_reg = PJ_TRUE;
|
||||||
|
unreg_first = PJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Contact param */
|
/* Contact param */
|
||||||
|
@ -1100,6 +1103,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
|
||||||
pj_bzero(&acc->cfg.reg_uri, sizeof(acc->cfg.reg_uri));
|
pj_bzero(&acc->cfg.reg_uri, sizeof(acc->cfg.reg_uri));
|
||||||
}
|
}
|
||||||
update_reg = PJ_TRUE;
|
update_reg = PJ_TRUE;
|
||||||
|
unreg_first = PJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SIP outbound setting */
|
/* SIP outbound setting */
|
||||||
|
@ -1110,6 +1114,16 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
|
||||||
update_reg = PJ_TRUE;
|
update_reg = PJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Unregister first */
|
||||||
|
if (unreg_first) {
|
||||||
|
pjsua_acc_set_registration(acc->index, PJ_FALSE);
|
||||||
|
if (acc->regc != NULL) {
|
||||||
|
pjsip_regc_destroy(acc->regc);
|
||||||
|
acc->regc = NULL;
|
||||||
|
acc->contact.slen = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Update registration */
|
/* Update registration */
|
||||||
if (update_reg) {
|
if (update_reg) {
|
||||||
/* If accounts has registration enabled, start registration */
|
/* If accounts has registration enabled, start registration */
|
||||||
|
|
|
@ -115,7 +115,7 @@ rdb_add_index(rdb_t *rdb, uint32_t index) {
|
||||||
|
|
||||||
/* shift the window forward by delta bits*/
|
/* shift the window forward by delta bits*/
|
||||||
v128_left_shift(&rdb->bitmask, delta);
|
v128_left_shift(&rdb->bitmask, delta);
|
||||||
v128_set_bit(&rdb->bitmask, rdb_bits_in_bitmask-delta);
|
v128_set_bit(&rdb->bitmask, rdb_bits_in_bitmask-1);
|
||||||
rdb->window_start += delta;
|
rdb->window_start += delta;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue