]> git.sesse.net Git - nageru/commitdiff
If we get a buffer underrun on resampling, reset the loop filter, since it probably...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 12 Feb 2017 18:36:56 +0000 (19:36 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 12 Feb 2017 18:36:56 +0000 (19:36 +0100)
resampling_queue.cpp

index b34e6f58c979bdc8d94b38678ba35e6e8ef63e36..7286d5cba535ebad5b757bc3ed1c2d2399d6d528 100644 (file)
@@ -162,6 +162,10 @@ bool ResamplingQueue::get_output_samples(steady_clock::time_point ts, float *sam
                        fprintf(stderr, "Card %u: PANIC: Out of input samples to resample, still need %d output samples! (correction factor is %f)\n",
                                card_num, int(vresampler.out_count), rcorr);
                        memset(vresampler.out_data, 0, vresampler.out_count * num_channels * sizeof(float));
+
+                       // Reset the loop filter.
+                       z1 = z2 = z3 = 0.0;
+
                        return false;
                }