FS-9990: [freeswitch-core] Exhaust fmtp sensitive codecs before moving on with negotiation in video #resolve

This commit is contained in:
Anthony Minessale 2017-01-30 15:36:33 -06:00
parent cf78b0c2ac
commit 230e8ac692
1 changed files with 6 additions and 2 deletions

View File

@ -4096,7 +4096,7 @@ static void restore_pmaps(switch_rtp_engine_t *engine)
//?
SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *session, const char *r_sdp, uint8_t *proceed, switch_sdp_type_t sdp_type)
{
uint8_t match = 0, vmatch = 0, tmatch = 0, fmatch = 0;
uint8_t match = 0, vmatch = 0, almost_vmatch = 0, tmatch = 0, fmatch = 0;
switch_payload_t best_te = 0, cng_pt = 0;
unsigned long best_te_rate = 8000, cng_rate = 8000;
sdp_media_t *m;
@ -5297,6 +5297,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
const char *inherit_video_fmtp = NULL;
vmatch = 0;
almost_vmatch = 0;
nm_idx = 0;
m_idx = 0;
memset(matches, 0, sizeof(matches[0]) * MAX_MATCHES);
@ -5462,6 +5463,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
if (sdp_type == SDP_TYPE_RESPONSE && consider_video_fmtp && vmatch && !zstr(map->rm_fmtp) && !zstr(smh->fmtps[i])) {
almost_vmatch = 1;
vmatch = !strcasecmp(smh->fmtps[i], map->rm_fmtp);
}
@ -5494,8 +5496,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
if (consider_video_fmtp && !m_idx) {
if (consider_video_fmtp && (!m_idx || almost_vmatch)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No matches with FTMP, fallback to ignoring FMTP\n");
almost_vmatch = 0;
m_idx = 0;
consider_video_fmtp = 0;
goto compare;
}