Do dB ratio check BEFORE it's used
This commit is contained in:
@ -1149,6 +1149,8 @@ int main(int argc, char** argv) {
|
||||
// This is only an approximate measure, to assist getting receive levels right:
|
||||
double full_scale_ratio = ((double)stream_amplitude_now / (byte_count_now ? byte_count_now : 1))/128;
|
||||
double dB_full_scale_ratio = 10*log10(full_scale_ratio);
|
||||
if (dB_full_scale_ratio > 1 || dB_full_scale_ratio == -INFINITY) // Guard against ridiculous reports
|
||||
dB_full_scale_ratio = -0.0;
|
||||
fprintf(stderr, "%4.1f MiB / %5.3f sec = %4.1f MiB/second, amplitude %3.1f dBfs",
|
||||
(byte_count_now / 1e6f),
|
||||
time_difference,
|
||||
@ -1170,8 +1172,6 @@ int main(int argc, char** argv) {
|
||||
} else {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
if (dB_full_scale_ratio > 1 || dB_full_scale_ratio == -INFINITY) // Guard against ridiculous reports
|
||||
dB_full_scale_ratio = -0.0;
|
||||
}
|
||||
|
||||
time_start = time_now;
|
||||
|
Reference in New Issue
Block a user