From 4c974bd99c5730bf891f21cf905f585b2e4591f0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 14 Oct 2015 00:54:36 +0200 Subject: [PATCH] Make the resampler zero out samples on underrun instead of just leaving junk. --- resampler.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.39.2