]> git.sesse.net Git - nageru/blobdiff - resampling_queue.cpp
Fix an issue with the correction factor locking to 0.95.
[nageru] / resampling_queue.cpp
index add0e50ac5bb7bcb065c012a8ba7845798917701..b34e6f58c979bdc8d94b38678ba35e6e8ef63e36 100644 (file)
@@ -77,6 +77,11 @@ bool ResamplingQueue::get_output_samples(steady_clock::time_point ts, float *sam
                return true;
        }
 
+       // This can happen when we get dropped frames on the master card.
+       if (duration<double>(ts.time_since_epoch()).count() <= 0.0) {
+               rate_adjustment_policy = DO_NOT_ADJUST_RATE;
+       }
+
        if (rate_adjustment_policy == ADJUST_RATE && (a0.good_sample || a1.good_sample)) {
                // Estimate the current number of input samples produced at
                // this instant in time, by extrapolating from the last known