提交 0b643a4a authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

C++: add brackets in conditions (more)

上级 2584ae44
......@@ -48,7 +48,9 @@ namespace RTC
new FeedbackRtpTransportPacket(commonHeader, len));
if (!packet->IsCorrect())
{
return nullptr;
}
return packet.release();
}
......@@ -399,7 +401,9 @@ namespace RTC
auto& packetResult = packetResults[idx];
if (!packetResult.received)
{
continue;
}
currentReceivedAtMs += this->deltas.at(deltaIdx) / 4;
packetResult.delta = this->deltas.at(deltaIdx);
......@@ -418,7 +422,9 @@ namespace RTC
uint16_t lost{ 0u };
if (expected == 0u)
{
return 0u;
}
for (auto* chunk : this->chunks)
{
......@@ -428,7 +434,9 @@ namespace RTC
// NOTE: If lost equals expected, the math below would produce 256, which
// becomes 0 in uint8_t.
if (lost == expected)
{
return 255u;
}
return (lost << 8) / expected;
}
......@@ -487,9 +495,13 @@ namespace RTC
Status status;
if (delta >= 0 && delta <= 255)
{
status = Status::SmallDelta;
}
else
{
status = Status::LargeDelta;
}
// Create a long run chunk before processing this packet, if needed.
// clang-format off
......@@ -576,7 +588,9 @@ namespace RTC
{
// No pending status packets.
if (this->context.statuses.empty())
{
return;
}
if (this->context.allSameStatus)
{
......@@ -638,9 +652,13 @@ namespace RTC
uint8_t symbolSize = data[0] & 0x40;
if (symbolSize == 0)
{
return new OneBitVectorChunk(bytes, count);
}
else
{
return new TwoBitVectorChunk(bytes, count);
}
}
return nullptr;
......@@ -717,9 +735,13 @@ namespace RTC
MS_TRACE();
if (this->status == Status::SmallDelta || this->status == Status::LargeDelta)
{
return this->count;
}
else
{
return 0u;
}
}
void FeedbackRtpTransportPacket::RunLengthChunk::FillResults(
......@@ -837,7 +859,9 @@ namespace RTC
for (auto status : this->statuses)
{
if (status == Status::SmallDelta || status == Status::LargeDelta)
{
count++;
}
}
return count;
......@@ -975,7 +999,9 @@ namespace RTC
for (auto status : this->statuses)
{
if (status == Status::SmallDelta || status == Status::LargeDelta)
{
count++;
}
}
return count;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论