]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] switch_rtp: fix switch_rtp_set_max_missed_packets logging
authorNorm Brandinger <n.brandinger@gmail.com>
Fri, 16 Apr 2021 14:24:51 +0000 (10:24 -0400)
committerGitHub <noreply@github.com>
Fri, 16 Apr 2021 14:24:51 +0000 (17:24 +0300)
Warning message about missed packets is misleading.
Message indicates greater (>) however, the conditional is greater than or equals (>=).
The message prints the value of rtp_sesstion->missed_count twice instead of printing the value of rtp_session->max_missed_packets.

src/switch_rtp.c

index e879436206084340992949c13e947bbb55a2edde..1b0d407decf07a8bcf292418d691ea12bf180d76 100644 (file)
@@ -2913,11 +2913,11 @@ SWITCH_DECLARE(void) switch_rtp_set_max_missed_packets(switch_rtp_t *rtp_session
                return;
        }
 
-       if (rtp_session->missed_count >= max) {
+       if (rtp_session->missed_count > max) {
 
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING,
                                                  "new max missed packets(%d->%d) greater than current missed packets(%d). RTP will timeout.\n",
-                                                 rtp_session->missed_count, max, rtp_session->missed_count);
+                                                 rtp_session->max_missed_packets, max, rtp_session->missed_count);
        }
 
        rtp_session->max_missed_packets = max;