Fixed ms_duration function to show actual ms (#1836)

This commit is contained in:
Mark Thompson 2024-01-31 14:08:17 -06:00 committed by GitHub
parent 13f12227bd
commit f59f5dfaa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ inline uint32_t ms_duration(
if (sample_rate == 0 || bytes_per_sample == 0)
return 0;
return buffer_size / bytes_per_sample / sample_rate * 1000;
return buffer_size * 1000 / (bytes_per_sample * sample_rate);
}
int fast_int_magnitude(int y, int x);