]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_amerge.c
Merge commit 'a854362b40f0e458db5a1fb0d2612a5702ee0ace'
[ffmpeg] / libavfilter / af_amerge.c
index 1ff3c8ca9874ee3b1eefff7807faf19e1f70490f..77ea297cd105efc63f33b3215a3cae95c48531ad 100644 (file)
@@ -102,7 +102,8 @@ static int query_formats(AVFilterContext *ctx)
     }
     if (overlap) {
         av_log(ctx, AV_LOG_WARNING,
-               "Inputs overlap: output layout will be meaningless\n");
+               "Input channel layouts overlap: "
+               "output layout will be determined by the number of distinct input channels\n");
         for (i = 0; i < nb_ch; i++)
             am->route[i] = i;
         outlayout = av_get_default_channel_layout(nb_ch);
@@ -309,14 +310,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
         return AVERROR(ENOMEM);
     for (i = 0; i < am->nb_inputs; i++) {
         char *name = av_asprintf("in%d", i);
-        if (!name)
-            return AVERROR(ENOMEM);
         AVFilterPad pad = {
             .name             = name,
             .type             = AVMEDIA_TYPE_AUDIO,
             .filter_samples   = filter_samples,
             .min_perms        = AV_PERM_READ | AV_PERM_PRESERVE,
         };
+        if (!name)
+            return AVERROR(ENOMEM);
         ff_insert_inpad(ctx, i, &pad);
     }
     return 0;