opusenc: Avoid resampler fractional sample offset
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 22 Jan 2017 05:31:12 +0000 (21:31 -0800)
committerMark Harris <mark.hsj@gmail.com>
Sun, 22 Jan 2017 05:48:11 +0000 (21:48 -0800)
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
src/audio-in.c

index 118efee..a71292b 100644 (file)
@@ -1012,7 +1012,7 @@ int setup_resample(oe_enc_opt *opt, int complexity, long outfreq) {
     rs->resampler = speex_resampler_init(rs->channels, opt->rate, outfreq, complexity, &err);
     if(err!=0)fprintf(stderr, _("resampler error: %s\n"), speex_resampler_strerror(err));
 
-    opt->skip+=speex_resampler_get_output_latency(rs->resampler);
+    speex_resampler_skip_zeros(rs->resampler);
 
     rs->bufs = malloc(sizeof(float) * rs->bufsize * opt->channels);