summaryrefslogtreecommitdiffstats
path: root/audio/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-19 22:54:03 +0200
committerwm4 <wm4@nowhere>2015-07-19 22:54:03 +0200
commit253f6f1a9533a328908a6c97975583e7ec4dc5b2 (patch)
tree71d57d04c3c42cf881c584b97242d3f832a0ced8 /audio/filter
parent8749900b5fa6f1766e7ddf2e836d2417a034eff2 (diff)
downloadmpv-253f6f1a9533a328908a6c97975583e7ec4dc5b2.tar.bz2
mpv-253f6f1a9533a328908a6c97975583e7ec4dc5b2.tar.xz
af_lavrresample: always reinit resampler on filter reinit
This was a minor optimization to potentially avoid resampler reconfiguration when the filter is reinitialized. But filter reinitialization is a rare event, and the case when no reconfiguration is needed is even rarer. As such, this is an unnecessary micro- optimization and only adds potential for bugs.
Diffstat (limited to 'audio/filter')
-rw-r--r--audio/filter/af_lavrresample.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c
index e2c5ff95e1..bea3db3744 100644
--- a/audio/filter/af_lavrresample.c
+++ b/audio/filter/af_lavrresample.c
@@ -161,23 +161,6 @@ static int rate_from_speed(int rate, double speed)
return lrint(rate * speed);
}
-static bool needs_lavrctx_reconfigure(struct af_resample *s,
- struct mp_audio *in,
- struct mp_audio *out)
-{
- return s->ctx.in_rate_af != in->rate ||
- s->ctx.in_format != in->format ||
- !mp_chmap_equals(&s->ctx.in_channels, &in->channels) ||
- s->ctx.out_rate != out->rate ||
- s->ctx.out_format != out->format ||
- !mp_chmap_equals(&s->ctx.out_channels, &out->channels) ||
- s->ctx.filter_size != s->opts.filter_size ||
- s->ctx.phase_shift != s->opts.phase_shift ||
- s->ctx.linear != s->opts.linear ||
- s->ctx.cutoff != s->opts.cutoff;
-
-}
-
// Return the format libavresample should convert to, given the final output
// format mp_format. In some cases (S24) we perform an extra conversion step,
// and signal here what exactly libavresample should output. It will be the
@@ -384,7 +367,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
mp_chmap_equals(&in->channels, &orig_in.channels))
? AF_OK : AF_FALSE;
- if (r == AF_OK && needs_lavrctx_reconfigure(s, in, out))
+ if (r == AF_OK)
r = configure_lavrr(af, in, out, true);
return r;
}