提交 40982338 authored 作者: Dragos Oancea's avatar Dragos Oancea

FS-11965: RTCP: fix on rtcp_report_block->fraction - "if X packets were expected…

FS-11965: RTCP: fix on rtcp_report_block->fraction - "if X packets were expected and X was lost, we want 0xff to be reported, not 0"
(patch by Piotr Gregor <piotr@dataandsignal.com>)
上级 da9c1618
...@@ -1840,7 +1840,7 @@ static void rtcp_generate_report_block(switch_rtp_t *rtp_session, struct switch_ ...@@ -1840,7 +1840,7 @@ static void rtcp_generate_report_block(switch_rtp_t *rtp_session, struct switch_
pkt_lost = expected_pkt - stats->period_pkt_count; pkt_lost = expected_pkt - stats->period_pkt_count;
stats->cum_lost=stats->cum_lost+pkt_lost; stats->cum_lost=stats->cum_lost+pkt_lost;
if (expected_pkt > 0 && pkt_lost > 0) { if (expected_pkt > 0 && pkt_lost > 0) {
rtcp_report_block->fraction = (uint8_t) (pkt_lost * 256 / expected_pkt); rtcp_report_block->fraction = (pkt_lost == expected_pkt ? 255 : (uint8_t) (pkt_lost * 256 / expected_pkt)); /* if X packets were expected and X was lost, we want 0xff to be reported, not 0 */
} else { } else {
rtcp_report_block->fraction = 0; rtcp_report_block->fraction = 0;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论