refactor: resolve Sonar cpp:S1117 findings (#5908)

This commit is contained in:
Dave Lane authored and GitHub committed 2026-10-12 22:03:58 -04:00
1 parent 36ccab48d9
commit e2a56b3d17
34 files changed
+507 -448

No files matched your search

+5 -5
View File
@@ -1692,9 +1692,9 @@ namespace stream {
auto blockIndex = 0;
std::for_each(fec_blocks_begin, fec_blocks_end, [&](std::string_view &current_payload) {
auto packets = (current_payload.size() + (blocksize - 1)) / blocksize;
auto payload_packets = (current_payload.size() + (blocksize - 1)) / blocksize;
for (int x = 0; x < packets; ++x) {
for (int x = 0; x < payload_packets; ++x) {
auto *inspect = (video_packet_raw_t *) &current_payload[x * blocksize];
inspect->packet.frameIndex = (uint32_t) packet->frame_index();
@@ -1708,7 +1708,7 @@ namespace stream {
if (x == 0) {
inspect->packet.flags |= FLAG_SOF;
}
if (x == packets - 1) {
if (x == payload_packets - 1) {
inspect->packet.flags |= FLAG_EOF;
}
}
@@ -1944,7 +1944,7 @@ namespace stream {
fec_packet.rtp.sequenceNumber = util::endian::big<std::uint16_t>(sequenceNumber + x + 1);
fec_packet.fecHeader.fecShardIndex = x;
auto send_info = platf::send_info_t {
auto fec_send_info = platf::send_info_t {
(const char *) &fec_packet,
sizeof(fec_packet),
(const char *) shards_p[RTPA_DATA_SHARDS + x],
@@ -1954,7 +1954,7 @@ namespace stream {
session->audio.peer.port(),
session->localAddress,
};
platf::send(send_info);
platf::send(fec_send_info);
BOOST_LOG(verbose) << "Audio FEC ["sv << (sequenceNumber & ~(RTPA_DATA_SHARDS - 1)) << ' ' << x << "] :: send..."sv;
}
}