Skip to content

Commit

Permalink
transmit: print symbol size always in debug2
Browse files Browse the repository at this point in the history
The symbol size is printed only once (or more precisely few times,
because it is guarded by a thread-local variable and the sending may
pick a different runner). This, however, doesn't give representative
numbers when frame sizes differ (== compressed) because then may also FEC
symbol sizes so print it unconditionally at least with debug2 log level.

refers to GH-361
  • Loading branch information
MartinPulec committed Jan 4, 2024
1 parent 0bba07c commit aaa5998
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/transmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,17 +478,21 @@ static inline void check_symbol_size(int fec_symbol_size, int payload_len)
{
thread_local static bool status_printed = false;

if (status_printed) {
if (status_printed && log_level < LOG_LEVEL_DEBUG2) {
return;
}

if (fec_symbol_size > payload_len) {
LOG(LOG_LEVEL_WARNING) << "Warning: FEC symbol size exceeds payload size! "
"FEC symbol size: " << fec_symbol_size << "\n";
} else {
LOG(LOG_LEVEL_INFO) << "FEC symbol size: " << fec_symbol_size << ", symbols per packet: " <<
payload_len / fec_symbol_size << ", payload size: " <<
payload_len / fec_symbol_size * fec_symbol_size << "\n";
const int ll =
status_printed ? LOG_LEVEL_DEBUG2 : LOG_LEVEL_INFO;
LOG(ll) << "FEC symbol size: " << fec_symbol_size
<< ", symbols per packet: "
<< payload_len / fec_symbol_size << ", payload size: "
<< payload_len / fec_symbol_size * fec_symbol_size
<< "\n";
}
status_printed = true;
}
Expand Down

0 comments on commit aaa5998

Please sign in to comment.