status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, bytes);
+ if (*bytes) {
+ rtp_session->missed_count = 0;
+ }
+
if (check_rtcp_and_ice(rtp_session) == -1) {
return SWITCH_STATUS_GENERR;
}
ret = -1;
goto end;
}
-
+
+ if (rtp_session->max_missed_packets && read_loops == 1 && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
+ if (bytes) {
+ rtp_session->missed_count = 0;
+ } else if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {
+ ret = -2;
+ goto end;
+ }
+ }
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
//switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_CRIT, "Read bytes (%i) %ld\n", status, bytes);
goto end;
}
- if (rtp_session->max_missed_packets && read_loops == 1 && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
- if (bytes) {
- rtp_session->missed_count = 0;
- } else if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {
- ret = -2;
- goto end;
- }
- }
-
check = !bytes;
if (rtp_session->flags[SWITCH_RTP_FLAG_FLUSH]) {