From 55fc598d4c43d56722f0820dd52bdfc02d597a7e Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 28 Jul 2021 12:20:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnack=20fci=E7=9B=B8=E5=85=B3b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtcp/RtcpFCI.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Rtcp/RtcpFCI.cpp b/src/Rtcp/RtcpFCI.cpp index 16630b6a..cd79db37 100644 --- a/src/Rtcp/RtcpFCI.cpp +++ b/src/Rtcp/RtcpFCI.cpp @@ -155,13 +155,14 @@ string FCI_REMB::dumpString() const { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// FCI_NACK::FCI_NACK(uint16_t pid_h, const vector &type) { + assert(type.size() <= kBitSize); uint16_t blp_h = 0; - int i = kBitSize; + int i = 0; for (auto item : type) { - --i; if (item) { blp_h |= (1 << i); } + ++i; } blp = htons(blp_h); pid = htons(pid_h); @@ -187,7 +188,7 @@ vector FCI_NACK::getBitArray() const { auto blp_h = getBlp(); for (size_t i = 0; i < kBitSize; ++i) { - ret[i + 1] = blp_h & (1 << (kBitSize - i - 1)); + ret[i + 1] = blp_h & (1 << i); } return ret; }