Commit 3aec6fc9 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Improve speed detection index calculation (round, don't truncate).

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 7b6e2cf4
......@@ -240,7 +240,7 @@ SpeedSync::compare (double relative_speed)
{
int index = offset + frame_bits[f].frame * steps_per_frame;
const int index1 = index * relative_speed_inv;
const int index1 = lrint (index * relative_speed_inv);
if (index1 >= 0 && index1 < (int) fft_sync_bits.size())
{
umag += fft_sync_bits[index1][mi].umag;
......@@ -249,7 +249,7 @@ SpeedSync::compare (double relative_speed)
}
index += frames_per_block * steps_per_frame;
const int index2 = index * relative_speed_inv;
const int index2 = lrint (index * relative_speed_inv);
if (index2 >= 0 && index2 < (int) fft_sync_bits.size())
{
umag += fft_sync_bits[index2][mi].dmag;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment