]> git.sesse.net Git - nageru/commitdiff
Make the resampler zero out samples on underrun instead of just leaving junk.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 13 Oct 2015 22:54:36 +0000 (00:54 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 13 Oct 2015 22:54:36 +0000 (00:54 +0200)
resampler.cpp

index efa0f178da950680fa55a5c2594b95abc754841c..ee0ab8788ef0acefb5b1099d43d776d2e9f142c7 100644 (file)
@@ -19,6 +19,7 @@
 #include "resampler.h"
 
 #include <stdio.h>
+#include <string.h>
 #include <math.h>
 #include <zita-resampler/vresampler.h>
 
@@ -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;
                }