]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_join.c
avfilter: Constify all AVFilters
[ffmpeg] / libavfilter / af_join.c
index 8269045d36d36e93cd9e8ad0553a72852a969152..eb60fe9b29313354d3fb2bad3488f8d2292ab362 100644 (file)
@@ -188,8 +188,8 @@ static av_cold int join_init(AVFilterContext *ctx)
     for (i = 0; i < s->inputs; i++) {
         AVFilterPad pad = { 0 };
 
-        pad.type           = AVMEDIA_TYPE_AUDIO;
-        pad.name           = av_asprintf("input%d", i);
+        pad.type = AVMEDIA_TYPE_AUDIO;
+        pad.name = av_asprintf("input%d", i);
         if (!pad.name)
             return AVERROR(ENOMEM);
 
@@ -207,9 +207,12 @@ static av_cold void join_uninit(AVFilterContext *ctx)
     JoinContext *s = ctx->priv;
     int i;
 
+    for (i = 0; i < s->inputs && s->input_frames; i++) {
+        av_frame_free(&s->input_frames[i]);
+    }
+
     for (i = 0; i < ctx->nb_inputs; i++) {
         av_freep(&ctx->input_pads[i].name);
-        av_frame_free(&s->input_frames[i]);
     }
 
     av_freep(&s->channels);
@@ -224,12 +227,12 @@ static int join_query_formats(AVFilterContext *ctx)
     int i, ret;
 
     if ((ret = ff_add_channel_layout(&layouts, s->channel_layout)) < 0 ||
-        (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts)) < 0)
+        (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0)
         return ret;
 
     for (i = 0; i < ctx->nb_inputs; i++) {
         layouts = ff_all_channel_layouts();
-        if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts)) < 0)
+        if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0)
             return ret;
     }
 
@@ -525,7 +528,7 @@ static const AVFilterPad avfilter_af_join_outputs[] = {
     { NULL }
 };
 
-AVFilter ff_af_join = {
+const AVFilter ff_af_join = {
     .name           = "join",
     .description    = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
                                            "multi-channel output."),