X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fresampling_queue.cpp;h=711c1c5239f44aad7df9000711556bc2ff39c2d6;hb=23da824e1d61e37fbe0cc1c0f4d32052022a50ba;hp=ef7b73511ff596f7e93894fd703038ad370c8841;hpb=9b7d691b4cc5db7dbfc18c82e86c1207fcac4722;p=nageru diff --git a/nageru/resampling_queue.cpp b/nageru/resampling_queue.cpp index ef7b735..711c1c5 100644 --- a/nageru/resampling_queue.cpp +++ b/nageru/resampling_queue.cpp @@ -115,7 +115,7 @@ bool ResamplingQueue::get_output_samples(steady_clock::time_point ts, float *sam // so that we don't need a long period to stabilize at the beginning. if (err < 0.0) { int delay_samples_to_add = lrintf(-err); - for (ssize_t i = 0; i < delay_samples_to_add * num_channels; ++i) { + for (ssize_t i = 0; i < delay_samples_to_add * int(num_channels); ++i) { buffer.push_front(0.0f); } total_consumed_samples -= delay_samples_to_add; // Equivalent to increasing input_samples_received on a0 and a1. @@ -143,7 +143,7 @@ bool ResamplingQueue::get_output_samples(steady_clock::time_point ts, float *sam // (we start ResamplingQueues also when we e.g. switch sound sources), // but in general, a little bit of increased timing jitter is acceptable // right after a setup change like this. - double loop_bandwidth_hz = (total_consumed_samples < 4 * freq_in) ? 0.2 : 0.02; + double loop_bandwidth_hz = (total_consumed_samples < 4 * int(freq_in)) ? 0.2 : 0.02; // Set filters. The first filter much wider than the first one (20x as wide). double w = (2.0 * M_PI) * loop_bandwidth_hz * num_samples / freq_out;