]> git.sesse.net Git - ffmpeg/commitdiff
Make query_formats() print an error message if an auto-inserted scale
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Wed, 13 Jan 2010 00:09:24 +0000 (00:09 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Wed, 13 Jan 2010 00:09:24 +0000 (00:09 +0000)
filter cannot convert between input and output formats.

Originally committed as revision 21176 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/avfiltergraph.c

index d46548e3e2ae80b353a4db5660949355433dcf91..8fbbecf055051986c9a33f3ddf906a498b77c6fe 100644 (file)
@@ -147,11 +147,15 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                         return -1;
 
                     scale->filter->query_formats(scale);
-                    if(!avfilter_merge_formats(scale-> inputs[0]->in_formats,
-                                               scale-> inputs[0]->out_formats)||
-                       !avfilter_merge_formats(scale->outputs[0]->in_formats,
-                                               scale->outputs[0]->out_formats))
+                    if (((link = scale-> inputs[0]) &&
+                         !avfilter_merge_formats(link->in_formats, link->out_formats)) ||
+                        ((link = scale->outputs[0]) &&
+                         !avfilter_merge_formats(link->in_formats, link->out_formats))) {
+                        av_log(log_ctx, AV_LOG_ERROR,
+                               "Impossible to convert between the formats supported by the filter "
+                               "'%s' and the filter '%s'\n", link->src->name, link->dst->name);
                         return -1;
+                    }
                 }
             }
         }