]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt) 08/4708/2
authorAaron An <anjb@ti-net.com.cn>
Tue, 10 Jan 2017 11:54:16 +0000 (19:54 +0800)
committerJoshua Colp <jcolp@digium.com>
Thu, 12 Jan 2017 22:55:45 +0000 (16:55 -0600)
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

include/asterisk/rtp_engine.h

index 24af05693cf2a25eb07ddf999806b07ad52d38de..c4a5b6b41cc2ee83a5449472fa1eda85afc9e402 100644 (file)
@@ -369,7 +369,7 @@ struct ast_rtp_instance_stats {
 };
 
 #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; \
@@ -377,7 +377,7 @@ return 0; \
 }
 
 #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; \