diff --git a/src/switch_core_media.c b/src/switch_core_media.c index d4954ee6b1..912d5a5012 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -6672,10 +6672,6 @@ SWITCH_DECLARE(void) switch_core_session_write_blank_video(switch_core_session_t if (!height) height = 288; if (!fps) fps = 15; - if (!(width && height && fps)) { - return; - } - fr.packet = buf; fr.packetlen = buflen; fr.data = buf + 12; @@ -12439,7 +12435,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_media_params(switch_core_sessi *val++ = '\0'; } - if (name && val) { + if (val) { if (!strcmp(name, "aspect")) { aspect = val; vid++; @@ -15860,7 +15856,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess if (!(switch_core_codec_ready(session->write_codec) && switch_core_codec_ready(frame->codec))) goto error; - if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) { + if (frame->codec && session->write_codec->implementation != frame->codec->implementation) { if (session->write_impl.codec_id == frame->codec->implementation->codec_id || session->write_impl.microseconds_per_packet != frame->codec->implementation->microseconds_per_packet) { ptime_mismatch = TRUE; diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index d00b75d40c..9a33b43340 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -2130,7 +2130,7 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data break; } - if (ep->eavesdropper && switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) { + if (switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) { if (switch_core_session_write_video_frame(ep->eavesdropper, bug->video_ping_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error writing video to %s\n", switch_core_session_get_name(ep->eavesdropper)); ep->errs++; @@ -2178,10 +2178,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_pop_eavesdropper(switch_cor struct eavesdrop_pvt *ep = (struct eavesdrop_pvt *) switch_core_media_bug_get_user_data(bug); if (ep && ep->eavesdropper && ep->eavesdropper != session) { - switch_core_session_read_lock(ep->eavesdropper); - *sessionp = ep->eavesdropper; - switch_core_media_bug_set_flag(bug, SMBF_PRUNE); - status = SWITCH_STATUS_SUCCESS; + if (switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) { + *sessionp = ep->eavesdropper; + switch_core_media_bug_set_flag(bug, SMBF_PRUNE); + status = SWITCH_STATUS_SUCCESS; + } } } diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index f91fc2c69f..527058f70c 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -237,7 +237,7 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj) continue; } - if (switch_channel_media_up(b_channel)) { + if (read_frame && switch_channel_media_up(b_channel)) { if (switch_core_session_write_video_frame(vh->session_b, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { switch_cond_next(); continue; diff --git a/src/switch_nat.c b/src/switch_nat.c index f6b9bc553b..a1620b4bfd 100644 --- a/src/switch_nat.c +++ b/src/switch_nat.c @@ -506,7 +506,7 @@ static switch_status_t switch_nat_add_mapping_upnp(switch_port_t port, switch_na if (r == UPNPCOMMAND_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mapped public port %s protocol %s to localport %s\n", port_str, - (proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str); + (proto == SWITCH_NAT_TCP) ? "TCP" : "UDP", port_str); status = SWITCH_STATUS_SUCCESS; } @@ -566,7 +566,7 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na if (r == UPNPCOMMAND_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unmapped public port %s protocol %s to localport %s\n", port_str, - (proto == SWITCH_NAT_TCP) ? "TCP" : (proto == SWITCH_NAT_UDP ? "UDP" : "UNKNOWN"), port_str); + (proto == SWITCH_NAT_TCP) ? "TCP" : "UDP", port_str); status = SWITCH_STATUS_SUCCESS; } return status; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 8398717818..ad9f8eef1c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1277,7 +1277,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d } - if (ice->ice_params && ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type && + if (ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type && !strcasecmp(ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type, "relay")) { do_adj++; } @@ -3010,7 +3010,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_ rtp_session->dtls->sock_output = rtp_session->sock_output; if (rtp_session->flags[SWITCH_RTP_FLAG_RTCP_MUX]) { - switch_sockaddr_info_get(&rtp_session->dtls->remote_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool); + status = switch_sockaddr_info_get(&rtp_session->dtls->remote_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool); } }