From: Steinar H. Gunderson Date: Tue, 13 Oct 2015 22:54:36 +0000 (+0200) Subject: Make the resampler zero out samples on underrun instead of just leaving junk. X-Git-Tag: 1.0.0~230 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4c974bd99c5730bf891f21cf905f585b2e4591f0;p=nageru Make the resampler zero out samples on underrun instead of just leaving junk. --- diff --git a/resampler.cpp b/resampler.cpp index efa0f17..ee0ab87 100644 --- a/resampler.cpp +++ b/resampler.cpp @@ -19,6 +19,7 @@ #include "resampler.h" #include +#include #include #include @@ -114,6 +115,7 @@ void Resampler::get_output_samples(double pts, float *samples, ssize_t num_sampl // or we're dropping a lot of data. fprintf(stderr, "PANIC: Out of input samples to resample, still need %d output samples!\n", int(vresampler.out_count)); + memset(vresampler.out_data, 0, vresampler.out_count * sizeof(float)); break; }