+ for (i = 0; i < ctx->nb_outputs; i++)
+ av_freep(&ctx->output_pads[i].name);
+}
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ AudioPhaseMeterContext *s = ctx->priv;
+ AVFilterPad pad;
+
+ pad = (AVFilterPad){
+ .name = av_strdup("out0"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ };
+ if (!pad.name)
+ return AVERROR(ENOMEM);
+ ff_insert_outpad(ctx, 0, &pad);
+
+ if (s->do_video) {
+ pad = (AVFilterPad){
+ .name = av_strdup("out1"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_video_output,
+ };
+ if (!pad.name)
+ return AVERROR(ENOMEM);
+ ff_insert_outpad(ctx, 1, &pad);
+ }
+
+ return 0;