mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-19 01:45:32 +00:00
FS-7508: trying to mitigate chrome going crazy on reload
This commit is contained in:
parent
d6e5bb7a42
commit
d6ef34a725
@ -501,6 +501,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
|
|||||||
switch_size_t len;
|
switch_size_t len;
|
||||||
vpx_codec_ctx_t *decoder = NULL;
|
vpx_codec_ctx_t *decoder = NULL;
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
int is_keyframe = ((*(unsigned char *)frame->data) & 0x01) ? 0 : 1;
|
||||||
|
|
||||||
if (!context->decoder_init) {
|
if (!context->decoder_init) {
|
||||||
init_codec(codec);
|
init_codec(codec);
|
||||||
@ -515,10 +516,11 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
|
|||||||
|
|
||||||
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "len: %d ts: %" SWITCH_SIZE_T_FMT " mark:%d\n", frame->datalen, frame->timestamp, frame->m);
|
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "len: %d ts: %" SWITCH_SIZE_T_FMT " mark:%d\n", frame->datalen, frame->timestamp, frame->m);
|
||||||
|
|
||||||
if (context->last_received_timestamp && context->last_received_timestamp != frame->timestamp &&
|
if (!is_keyframe && context->last_received_timestamp && context->last_received_timestamp != frame->timestamp &&
|
||||||
(!frame->m) && (!context->last_received_complete_picture)) {
|
(!frame->m) && (!context->last_received_complete_picture)) {
|
||||||
// possible packet loss
|
// possible packet loss
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Reset\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Reset\n");
|
||||||
|
context->need_key_frame = 1;
|
||||||
switch_goto_status(SWITCH_STATUS_RESTART, end);
|
switch_goto_status(SWITCH_STATUS_RESTART, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9010,18 +9010,12 @@ SWITCH_DECLARE(void) switch_core_session_stop_media(switch_core_session_t *sessi
|
|||||||
v_engine = &smh->engines[SWITCH_MEDIA_TYPE_VIDEO];
|
v_engine = &smh->engines[SWITCH_MEDIA_TYPE_VIDEO];
|
||||||
|
|
||||||
if (a_engine->rtp_session) {
|
if (a_engine->rtp_session) {
|
||||||
switch_rtp_del_dtls(a_engine->rtp_session, DTLS_TYPE_RTP|DTLS_TYPE_RTCP);
|
switch_rtp_reset(a_engine->rtp_session);
|
||||||
switch_rtp_set_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE);
|
|
||||||
switch_rtp_set_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_MUTE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v_engine->rtp_session) {
|
if (v_engine->rtp_session) {
|
||||||
switch_rtp_del_dtls(v_engine->rtp_session, DTLS_TYPE_RTP|DTLS_TYPE_RTCP);
|
switch_rtp_reset(v_engine->rtp_session);
|
||||||
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE);
|
|
||||||
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_MUTE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2542,6 +2542,22 @@ SWITCH_DECLARE(void) switch_rtp_reset(switch_rtp_t *rtp_session)
|
|||||||
rtp_session->ts = 0;
|
rtp_session->ts = 0;
|
||||||
memset(&rtp_session->ts_norm, 0, sizeof(rtp_session->ts_norm));
|
memset(&rtp_session->ts_norm, 0, sizeof(rtp_session->ts_norm));
|
||||||
|
|
||||||
|
|
||||||
|
switch_rtp_del_dtls(rtp_session, DTLS_TYPE_RTP|DTLS_TYPE_RTCP);
|
||||||
|
switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_PAUSE);
|
||||||
|
switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_MUTE);
|
||||||
|
|
||||||
|
|
||||||
|
if (rtp_session->ice.ready) {
|
||||||
|
if (rtp_session->vb) {
|
||||||
|
switch_vb_reset(rtp_session->vb);
|
||||||
|
}
|
||||||
|
if (rtp_session->vbw) {
|
||||||
|
switch_vb_reset(rtp_session->vbw);
|
||||||
|
}
|
||||||
|
rtp_session->ice.ready = rtp_session->ice.rready = 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_rtp_reset_media_timer(switch_rtp_t *rtp_session)
|
SWITCH_DECLARE(void) switch_rtp_reset_media_timer(switch_rtp_t *rtp_session)
|
||||||
@ -3949,21 +3965,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio
|
|||||||
|
|
||||||
if (proto == IPR_RTP) {
|
if (proto == IPR_RTP) {
|
||||||
ice = &rtp_session->ice;
|
ice = &rtp_session->ice;
|
||||||
|
|
||||||
rtp_session->flags[SWITCH_RTP_FLAG_PAUSE] = 0;
|
rtp_session->flags[SWITCH_RTP_FLAG_PAUSE] = 0;
|
||||||
rtp_session->flags[SWITCH_RTP_FLAG_MUTE] = 0;
|
rtp_session->flags[SWITCH_RTP_FLAG_MUTE] = 0;
|
||||||
|
|
||||||
switch_core_session_video_reinit(rtp_session->session);
|
switch_core_session_video_reinit(rtp_session->session);
|
||||||
|
|
||||||
if (ice->ready) {
|
|
||||||
if (rtp_session->vb) {
|
|
||||||
switch_vb_reset(rtp_session->vb);
|
|
||||||
}
|
|
||||||
if (rtp_session->vbw) {
|
|
||||||
switch_vb_reset(rtp_session->vbw);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ice = &rtp_session->rtcp_ice;
|
ice = &rtp_session->rtcp_ice;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user