[Asterisk-code-review] res rtp asterisk: Fix bug in Function CHANNLE(rtcp, all rtt) (asterisk[master])

Aaron An asteriskteam at digium.com
Tue Jan 10 05:56:59 CST 2017


Aaron An has uploaded a new change for review. ( https://gerrit.asterisk.org/4707 )

Change subject: res_rtp_asterisk:  Fix bug in Function CHANNLE(rtcp, all_rtt)
......................................................................

res_rtp_asterisk:  Fix bug in Function CHANNLE(rtcp, all_rtt)

Function CHANNEL(rtcp,all_rtt) CHANNEL(rtcp,all_loss) CHANNEL(rtcp,all_jitter)
always return 0.0 due to wrong define of macro "AST_RTP_SATA_SET" and
"AST_RTP_STAT_STRCPY".
It should compare "combined" with "stat" not "current_stat".

ASTERISK-26710 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: Id4140fafbf92e2db689dac5b17d9caa009028a15
---
M include/asterisk/rtp_engine.h
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/4707/1

diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index 017bb7b..c0ae331 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -373,7 +373,7 @@
 };
 
 #define AST_RTP_STAT_SET(current_stat, combined, placement, value) \
-if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == current_stat)) { \
+if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == stat)) { \
 placement = value; \
 if (stat == current_stat) { \
 return 0; \
@@ -381,7 +381,7 @@
 }
 
 #define AST_RTP_STAT_STRCPY(current_stat, combined, placement, value) \
-if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == current_stat)) { \
+if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == stat)) { \
 	ast_copy_string(placement, value, sizeof(placement)); \
 	if (stat == current_stat) { \
 		return 0; \

-- 
To view, visit https://gerrit.asterisk.org/4707
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4140fafbf92e2db689dac5b17d9caa009028a15
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Aaron An <anjb at ti-net.com.cn>



More information about the asterisk-code-review mailing list