if (!height) height = 288;
if (!fps) fps = 15;
- if (!(width && height && fps)) {
- return;
- }
-
fr.packet = buf;
fr.packetlen = buflen;
fr.data = buf + 12;
*val++ = '\0';
}
- if (name && val) {
+ if (val) {
if (!strcmp(name, "aspect")) {
aspect = val;
vid++;
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;
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++;
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;
+ }
}
}
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;
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;
}
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;
}
- 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++;
}
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);
}
}