]> git.sesse.net Git - nageru/blobdiff - resampler.h
Re-run IWYU, again with lots of manual cleanup.
[nageru] / resampler.h
index aa7af3dd3feff07fe600d3c2b12dc99af751b228..7d3b6025eb7b490655bcf2327e6c3db280195888 100644 (file)
 
 #include <stdint.h>
 #include <stdlib.h>
+#include <sys/types.h>
 #include <zita-resampler/vresampler.h>
-
 #include <deque>
+#include <memory>
 
 class Resampler {
 public:
@@ -50,7 +51,7 @@ public:
 
        // Note: pts is always in seconds.
        void add_input_samples(double pts, const float *samples, ssize_t num_samples);
-       void get_output_samples(double pts, float *samples, ssize_t num_samples);
+       bool get_output_samples(double pts, float *samples, ssize_t num_samples);  // Returns false if underrun.
 
 private:
        void init_loop_filter(double bandwidth_hz);
@@ -80,7 +81,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 = 1600.0;
+       double expected_delay = 4800.0;
 
        // Input samples not yet fed into the resampler.
        // TODO: Use a circular buffer instead, for efficiency.