]> git.sesse.net Git - nageru/commitdiff
Loosen up an assert that would sometimes trigger when resetting FFmpeg sources.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 27 Apr 2018 20:26:25 +0000 (22:26 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 27 Apr 2018 20:26:25 +0000 (22:26 +0200)
bmusb
resampling_queue.cpp

diff --git a/bmusb b/bmusb
index e287f28087aef9cfd6aa47acd0d283bc177a9d70..6a012a41c5422092cdac1f18a9019f37c0b85368 160000 (submodule)
--- a/bmusb
+++ b/bmusb
@@ -1 +1 @@
-Subproject commit e287f28087aef9cfd6aa47acd0d283bc177a9d70
+Subproject commit 6a012a41c5422092cdac1f18a9019f37c0b85368
index a1a2395533ae168abf1efe2a737cf710a9722e0a..ef7b73511ff596f7e93894fd703038ad370c8841 100644 (file)
@@ -60,7 +60,11 @@ void ResamplingQueue::add_input_samples(steady_clock::time_point ts, const float
        a1.good_sample = good_sample;
        if (a0.good_sample && a1.good_sample) {
                current_estimated_freq_in = (a1.input_samples_received - a0.input_samples_received) / duration<double>(a1.ts - a0.ts).count();
-               assert(current_estimated_freq_in >= 0.0);
+               if (!(current_estimated_freq_in >= 0.0)) {
+                       fprintf(stderr, "%s: PANIC: Input audio clock going backwards, ignoring.\n",
+                               spec_to_string(device_spec).c_str());
+                       current_estimated_freq_in = freq_in;
+               }
 
                // Bound the frequency, so that a single wild result won't throw the filter off guard.
                current_estimated_freq_in = min(current_estimated_freq_in, 1.2 * freq_in);