[FFmpeg-cvslog] avfilter/af_sofalizer: stop allocating never used buffers
Paul B Mahol
git at videolan.org
Mon Dec 31 20:42:23 EET 2018
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Dec 31 19:40:18 2018 +0100| [51b356eef85df7864b673b9cc990210bca631a04] | committer: Paul B Mahol
avfilter/af_sofalizer: stop allocating never used buffers
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51b356eef85df7864b673b9cc990210bca631a04
---
libavfilter/af_sofalizer.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 52c3b49ccd..48123594a6 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -719,12 +719,20 @@ static int load_data(AVFilterContext *ctx, int azim, int elev, float radius, int
n_samples = s->sofa.n_samples;
ir_samples = s->sofa.ir_samples;
- s->data_ir[0] = av_calloc(n_samples, sizeof(float) * s->n_conv);
- s->data_ir[1] = av_calloc(n_samples, sizeof(float) * s->n_conv);
+ if (s->type == TIME_DOMAIN) {
+ s->data_ir[0] = av_calloc(n_samples, sizeof(float) * s->n_conv);
+ s->data_ir[1] = av_calloc(n_samples, sizeof(float) * s->n_conv);
+
+ if (!s->data_ir[0] || !s->data_ir[1]) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ }
+
s->delay[0] = av_calloc(s->n_conv, sizeof(int));
s->delay[1] = av_calloc(s->n_conv, sizeof(int));
- if (!s->data_ir[0] || !s->data_ir[1] || !s->delay[0] || !s->delay[1]) {
+ if (!s->delay[0] || !s->delay[1]) {
ret = AVERROR(ENOMEM);
goto fail;
}
More information about the ffmpeg-cvslog
mailing list