summaryrefslogtreecommitdiff
path: root/libswresample/resample.c
diff options
context:
space:
mode:
Diffstat (limited to 'libswresample/resample.c')
-rw-r--r--libswresample/resample.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 8635bf1bed..e65a57a877 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -496,7 +496,12 @@ static int swri_resample(ResampleContext *c,
dst_size = FFMIN(dst_size, delta_n);
if (dst_size > 0) {
- *consumed = c->dsp.resample(c, dst, src, dst_size, update_ctx);
+ /* resample_linear and resample_common should have same behavior
+ * when frac and dst_incr_mod are zero */
+ if (c->linear && (c->frac || c->dst_incr_mod))
+ *consumed = c->dsp.resample_linear(c, dst, src, dst_size, update_ctx);
+ else
+ *consumed = c->dsp.resample_common(c, dst, src, dst_size, update_ctx);
} else {
*consumed = 0;
}