swr: handle initial negative sample index outside DSP function.
[ffmpeg.git] / libswresample / soxr_resample.c
index 15fcc83..064451d 100644 (file)
@@ -47,7 +47,11 @@ static struct ResampleContext *create(struct ResampleContext *c, int out_rate, i
 
     soxr_quality_spec_t q_spec = soxr_quality_spec((int)((precision-2)/4), (SOXR_HI_PREC_CLOCK|SOXR_ROLLOFF_NONE)*!!cheby);
     q_spec.precision = linear? 0 : precision;
+#if !defined SOXR_VERSION /* Deprecated @ March 2013: */
     q_spec.bw_pc = cutoff? FFMAX(FFMIN(cutoff,.995),.8)*100 : q_spec.bw_pc;
+#else
+    q_spec.passband_end = cutoff? FFMAX(FFMIN(cutoff,.995),.8) : q_spec.passband_end;
+#endif
 
     soxr_delete((soxr_t)c);
     c = (struct ResampleContext *)
@@ -83,7 +87,14 @@ static int64_t get_delay(struct SwrContext *s, int64_t base){
     return (int64_t)(delay_s * base + .5);
 }
 
+static int invert_initial_buffer(struct ResampleContext *c, AudioData *dst, const AudioData *src,
+                                 int in_count, int *out_idx, int *out_sz)
+{
+    return 0;
+}
+
 struct Resampler const soxr_resampler={
     create, destroy, process, flush, NULL /* set_compensation */, get_delay,
+    invert_initial_buffer,
 };