]> git.sesse.net Git - nageru/commitdiff
Remove an erroneous assert in ResamplingQueue.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 11 Apr 2018 22:34:48 +0000 (00:34 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 11 Apr 2018 22:34:48 +0000 (00:34 +0200)
resampling_queue.cpp

index df0c335447d7fad746be1fbb176be6716cbe4590..06dc6fbf417bb1a13aae39f4cbf527e7740e5b6f 100644 (file)
@@ -91,9 +91,13 @@ bool ResamplingQueue::get_output_samples(steady_clock::time_point ts, float *sam
                // forward, depending on the timing of the calls.
                const InputPoint &base_point = a1.good_sample ? a1 : a0;
                assert(duration<double>(base_point.ts.time_since_epoch()).count() >= 0.0);
+
+               // NOTE: Due to extrapolation, input_samples_received can
+               // actually go negative here the few first calls (ie., we asked
+               // about a timestamp where we hadn't actually started producing
+               // samples yet), but that is harmless.
                const double input_samples_received = base_point.input_samples_received +
                        current_estimated_freq_in * duration<double>(ts - base_point.ts).count();
-               assert(input_samples_received >= 0.0);
 
                // Estimate the number of input samples _consumed_ after we've run the resampler.
                const double input_samples_consumed = total_consumed_samples +