- // Note: pts is always in seconds.
- void add_input_samples(double pts, const float *samples, ssize_t num_samples);
- bool get_output_samples(double pts, float *samples, ssize_t num_samples); // Returns false if underrun.
+ // 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
+ // dropped frames.
+ enum RateAdjustmentPolicy {
+ DO_NOT_ADJUST_RATE,
+ ADJUST_RATE
+ };
+
+ void add_input_samples(std::chrono::steady_clock::time_point ts, const float *samples, ssize_t num_samples, RateAdjustmentPolicy rate_adjustment_policy);
+ // Returns false if underrun.
+ bool get_output_samples(std::chrono::steady_clock::time_point ts, float *samples, ssize_t num_samples, RateAdjustmentPolicy rate_adjustment_policy);