Browse code

Make query_formats() print an error message if an auto-inserted scale filter cannot convert between input and output formats.

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

Stefano Sabatini authored on 2010/01/13 09:09:24
Showing 1 changed files
... ...
@@ -147,11 +147,15 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
147 147
                         return -1;
148 148
 
149 149
                     scale->filter->query_formats(scale);
150
-                    if(!avfilter_merge_formats(scale-> inputs[0]->in_formats,
151
-                                               scale-> inputs[0]->out_formats)||
152
-                       !avfilter_merge_formats(scale->outputs[0]->in_formats,
153
-                                               scale->outputs[0]->out_formats))
150
+                    if (((link = scale-> inputs[0]) &&
151
+                         !avfilter_merge_formats(link->in_formats, link->out_formats)) ||
152
+                        ((link = scale->outputs[0]) &&
153
+                         !avfilter_merge_formats(link->in_formats, link->out_formats))) {
154
+                        av_log(log_ctx, AV_LOG_ERROR,
155
+                               "Impossible to convert between the formats supported by the filter "
156
+                               "'%s' and the filter '%s'\n", link->src->name, link->dst->name);
154 157
                         return -1;
158
+                    }
155 159
                 }
156 160
             }
157 161
         }