X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=resampling_queue.h;h=662a837262e8b84fcf3680ceae65bdf38f0e0871;hb=605ebde8d784157641733f8eddf31012227888ce;hp=8462152e0fe91bee15bc24474db7e18254b9f5f2;hpb=40639263a6782d2d515d7bd626a9e4ff6c1ea870;p=nageru diff --git a/resampling_queue.h b/resampling_queue.h index 8462152..662a837 100644 --- a/resampling_queue.h +++ b/resampling_queue.h @@ -48,7 +48,7 @@ class ResamplingQueue { public: // card_num is for debugging outputs only. - ResamplingQueue(unsigned card_num, unsigned freq_in, unsigned freq_out, unsigned num_channels = 2); + ResamplingQueue(unsigned card_num, unsigned freq_in, unsigned freq_out, unsigned num_channels, double expected_delay_seconds); // If policy is DO_NOT_ADJUST_RATE, the resampling rate will not be changed. // This is primarily useful if you have an extraordinary situation, such as @@ -92,7 +92,7 @@ private: // How much delay we are expected to have, in input samples. // If actual delay drifts too much away from this, we will start // changing the resampling ratio to compensate. - double expected_delay = OUTPUT_FREQUENCY * 0.1; // 100 ms. + double expected_delay; // Input samples not yet fed into the resampler. // TODO: Use a circular buffer instead, for efficiency.