X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavfilter%2Faf_amix.c;h=e40969f70cf7335c11b3953c6b97b083850e265e;hp=d8a6651fcebafe4734b769fe773232ee1c99e62a;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavfilter/af_amix.c b/ffmpeg/libavfilter/af_amix.c index d8a6651..e40969f 100644 --- a/ffmpeg/libavfilter/af_amix.c +++ b/ffmpeg/libavfilter/af_amix.c @@ -155,7 +155,7 @@ static int frame_list_add_frame(FrameList *frame_list, int nb_samples, int64_t p typedef struct MixContext { const AVClass *class; /**< class for AVOptions */ - AVFloatDSPContext fdsp; + AVFloatDSPContext *fdsp; int nb_inputs; /**< number of inputs */ int active_inputs; /**< number of input currently active */ @@ -298,7 +298,7 @@ static int output_frame(AVFilterLink *outlink, int nb_samples) plane_size = FFALIGN(plane_size, 16); for (p = 0; p < planes; p++) { - s->fdsp.vector_fmac_scalar((float *)out_buf->extended_data[p], + s->fdsp->vector_fmac_scalar((float *)out_buf->extended_data[p], (float *) in_buf->extended_data[p], s->input_scale[i], plane_size); } @@ -501,7 +501,9 @@ static av_cold int init(AVFilterContext *ctx) ff_insert_inpad(ctx, i, &pad); } - avpriv_float_dsp_init(&s->fdsp, 0); + s->fdsp = avpriv_float_dsp_alloc(0); + if (!s->fdsp) + return AVERROR(ENOMEM); return 0; } @@ -520,6 +522,7 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->frame_list); av_freep(&s->input_state); av_freep(&s->input_scale); + av_freep(&s->fdsp); for (i = 0; i < ctx->nb_inputs; i++) av_freep(&ctx->input_pads[i].name); @@ -528,10 +531,17 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats = NULL; + AVFilterChannelLayouts *layouts; + + layouts = ff_all_channel_layouts(); + + if (!layouts) + return AVERROR(ENOMEM); + ff_add_format(&formats, AV_SAMPLE_FMT_FLT); ff_add_format(&formats, AV_SAMPLE_FMT_FLTP); ff_set_common_formats(ctx, formats); - ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); + ff_set_common_channel_layouts(ctx, layouts); ff_set_common_samplerates(ctx, ff_all_samplerates()); return 0; }