OSDN Git Service

lavfi/avfiltergraph: suggest a solution when format selection fails.
authorNicolas George <nicolas.george@normalesup.org>
Tue, 3 Sep 2013 20:12:54 +0000 (22:12 +0200)
committerNicolas George <george@nsup.org>
Sun, 3 Nov 2013 09:30:08 +0000 (10:30 +0100)
Format selection can fail if unknown channel layouts are used
with filters that do not support it.

libavfilter/avfiltergraph.c

index 506d79e..bcdcde0 100644 (file)
@@ -654,6 +654,10 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref)
             av_log(link->src, AV_LOG_ERROR, "Cannot select channel layout for"
                    " the link between filters %s and %s.\n", link->src->name,
                    link->dst->name);
+            if (!link->in_channel_layouts->all_counts)
+                av_log(link->src, AV_LOG_ERROR, "Unknown channel layouts not "
+                       "supported, try specifying a channel layout using "
+                       "'aformat=channel_layouts=something'.\n");
             return AVERROR(EINVAL);
         }
         link->in_channel_layouts->nb_channel_layouts = 1;