[FFmpeg-cvslog] avfilter/af_acrossover: remove pointless allocation of static size

Paul B Mahol git at videolan.org
Wed Dec 2 14:56:57 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Dec  2 12:38:29 2020 +0100| [b0298ad4e5448d949c6e4a3cdd55de223cb59865] | committer: Paul B Mahol

avfilter/af_acrossover: remove pointless allocation of static size

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0298ad4e5448d949c6e4a3cdd55de223cb59865
---

 libavfilter/af_acrossover.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index 241f1dbb77..60bb2330f0 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -62,7 +62,7 @@ typedef struct AudioCrossoverContext {
     int first_order;
     int ap_filter_count;
     int nb_splits;
-    float *splits;
+    float splits[MAX_SPLITS];
 
     BiquadCoeffs lp[MAX_BANDS][20];
     BiquadCoeffs hp[MAX_BANDS][20];
@@ -110,10 +110,6 @@ static av_cold int init(AVFilterContext *ctx)
     if (!s->fdsp)
         return AVERROR(ENOMEM);
 
-    s->splits = av_calloc(MAX_SPLITS, sizeof(*s->splits));
-    if (!s->splits)
-        return AVERROR(ENOMEM);
-
     p = s->splits_str;
     for (i = 0; i < MAX_SPLITS; i++) {
         float freq;
@@ -513,7 +509,6 @@ static av_cold void uninit(AVFilterContext *ctx)
     int i;
 
     av_freep(&s->fdsp);
-    av_freep(&s->splits);
     av_frame_free(&s->xover);
 
     for (i = 0; i < ctx->nb_outputs; i++)



More information about the ffmpeg-cvslog mailing list