We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87d37c3 commit 21768b1Copy full SHA for 21768b1
1 file changed
audio/src/fetch/receive.rs
@@ -120,7 +120,9 @@ async fn receive_data(
120
if measure_throughput {
121
let duration = Instant::now().duration_since(request_time).as_millis();
122
if actual_length > 0 && duration > 0 {
123
- let throughput = ONE_SECOND.as_millis() as usize * actual_length / duration as usize;
+ // Use u64 for intermediate calculation to avoid overflow on 32-bit platforms
124
+ let throughput =
125
+ (ONE_SECOND.as_millis() as u64 * actual_length as u64 / duration as u64) as usize;
126
file_data_tx.send(ReceivedData::Throughput(throughput))?;
127
}
128
0 commit comments