diff options
author | Corey Farrell <git@cfware.com> | 2018-03-07 15:36:17 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2018-03-07 16:03:01 -0600 |
commit | c8a521b6c804d66abb367783dba75eecb16889a2 (patch) | |
tree | cd017f42216be9712f6b38cacffd8d6a67484844 /res/res_rtp_asterisk.c | |
parent | 9040057db38dbc3d8181a5405d13ed8c8083d438 (diff) |
Replace direct checks of option_debug with DEBUG_ATLEAST macro.
Checking option_debug directly is incorrect as it ignores file/module
specific debug settings. This system-wide change replaces nearly all
direct checks for option_debug with the DEBUG_ATLEAST macro.
Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r-- | res/res_rtp_asterisk.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index b53b38ad7..d0e482405 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -4565,11 +4565,9 @@ static int ast_rtp_write(struct ast_rtp_instance *instance, struct ast_frame *fr format = frame->subclass.format; if (ast_format_cmp(rtp->lasttxformat, format) == AST_FORMAT_CMP_NOT_EQUAL) { /* Oh dear, if the format changed we will have to set up a new smoother */ - if (option_debug > 0) { - ast_debug(1, "Ooh, format changed from %s to %s\n", - ast_format_get_name(rtp->lasttxformat), - ast_format_get_name(frame->subclass.format)); - } + ast_debug(1, "Ooh, format changed from %s to %s\n", + ast_format_get_name(rtp->lasttxformat), + ast_format_get_name(frame->subclass.format)); ao2_replace(rtp->lasttxformat, format); if (rtp->smoother) { ast_smoother_free(rtp->smoother); @@ -5744,7 +5742,7 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, ast_sockaddr_stringify(&remote_address), strerror(errno)); } else if (((ast_test_flag(bridged, FLAG_NAT_ACTIVE) == FLAG_NAT_INACTIVE) || rtpdebug) && !ast_test_flag(bridged, FLAG_NAT_INACTIVE_NOWARN)) { - if (option_debug || rtpdebug) { + if (rtpdebug || DEBUG_ATLEAST(1)) { ast_log(LOG_WARNING, "RTP NAT: Can't write RTP to private " "address %s, waiting for other end to " @@ -6117,13 +6115,14 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc if (ext) { hdrlen += (ntohl(rtpheader[hdrlen/4]) & 0xffff) << 2; hdrlen += 4; - if (option_debug) { + if (DEBUG_ATLEAST(1)) { unsigned int profile; profile = (ntohl(rtpheader[3]) & 0xffff0000) >> 16; - if (profile == 0x505a) - ast_debug(1, "Found Zfone extension in RTP stream - zrtp - not supported.\n"); - else - ast_debug(1, "Found unknown RTP Extensions %x\n", profile); + if (profile == 0x505a) { + ast_log(LOG_DEBUG, "Found Zfone extension in RTP stream - zrtp - not supported.\n"); + } else { + ast_log(LOG_DEBUG, "Found unknown RTP Extensions %x\n", profile); + } } } |