History

avfilter/af_headphone: Avoid allocating array

Andreas Rheinhardt committed 6 years ago

Commit 6ada3c81 parent 6d0d25e1 file · +1 −6Browse files

Unified · Split

libavfilter/af_headphone.c+1−6
@@ -79,7 +79,7 @@ typedef struct HeadphoneContext { · 78 unmodified lines
79 struct hrir_inputs {79 struct hrir_inputs {
80 int ir_len;80 int ir_len;
81 int eof;81 int eof;
82 } *hrir_in;82 } hrir_in[64];
83 uint64_t mapping[64];83 uint64_t mapping[64];
84} HeadphoneContext;84} HeadphoneContext;
85 85
@@ -654,10 +654,6 @@ static av_cold int init(AVFilterContext *ctx) · 568 unmodified lines
654 654
655 parse_map(ctx);655 parse_map(ctx);
656 656
657 s->hrir_in = av_calloc(s->nb_hrir_inputs, sizeof(*s->hrir_in));
658 if (!s->hrir_in)
659 return AVERROR(ENOMEM);
660
661 for (i = 0; i < s->nb_hrir_inputs; i++) {657 for (i = 0; i < s->nb_hrir_inputs; i++) {
662 char *name = av_asprintf("hrir%d", i);658 char *name = av_asprintf("hrir%d", i);
663 AVFilterPad pad = {659 AVFilterPad pad = {
@@ -721,7 +717,6 @@ static av_cold void uninit(AVFilterContext *ctx) · 57 unmodified lines
721 av_freep(&s->data_hrtf[1]);717 av_freep(&s->data_hrtf[1]);
722 av_freep(&s->fdsp);718 av_freep(&s->fdsp);
723 719
724 av_freep(&s->hrir_in);
725 for (unsigned i = 1; i < ctx->nb_inputs; i++)720 for (unsigned i = 1; i < ctx->nb_inputs; i++)
726 av_freep(&ctx->input_pads[i].name);721 av_freep(&ctx->input_pads[i].name);
727}722}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t