From e0dd9e22b11a7e812b9ff708370426c564ac8005 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 12 Feb 2017 19:36:56 +0100 Subject: [PATCH] If we get a buffer underrun on resampling, reset the loop filter, since it probably contains bad data. --- resampling_queue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resampling_queue.cpp b/resampling_queue.cpp index b34e6f5..7286d5c 100644 --- a/resampling_queue.cpp +++ b/resampling_queue.cpp @@ -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; } -- 2.39.2