Originally committed as revision 12751 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -68,20 +68,16 @@ static int query_formats(AVFilterGraph *graph) · 67 unmodified lines | |||
| 68 | AVFilterContext *filter = graph->filters[i]; | 68 | AVFilterContext *filter = graph->filters[i]; |
| 69 | 69 | ||
| 70 | for(j = 0; j < filter->input_count; j ++) { | 70 | for(j = 0; j < filter->input_count; j ++) { |
| 71 | AVFilterLink *link; | 71 | AVFilterLink *link = filter->inputs[j]; |
| 72 | if(!(link = filter->inputs[j])) | 72 | if(link && link->in_formats != link->out_formats) { |
| 73 | continue; | ||
| 74 | if(link->in_formats != link->out_formats) { | ||
| 75 | if(!avfilter_merge_formats(link->in_formats, | 73 | if(!avfilter_merge_formats(link->in_formats, |
| 76 | link->out_formats)) { | 74 | link->out_formats)) { |
| 77 | /* couldn't merge format lists. auto-insert scale filter */ | 75 | /* couldn't merge format lists. auto-insert scale filter */ |
| 78 | AVFilterContext *scale; | 76 | AVFilterContext *scale = |
| 77 | avfilter_open(avfilter_get_by_name("scale"), NULL); | ||
| 79 | 78 | ||
| 80 | if(!(scale = | 79 | if(!scale || scale->filter->init(scale, NULL, NULL) || |
| 81 | avfilter_open(avfilter_get_by_name("scale"), NULL))) | 80 | avfilter_insert_filter(link, scale, 0, 0)) { |
| 82 | return -1; | ||
| 83 | if(scale->filter->init(scale, NULL, NULL) || | ||
| 84 | avfilter_insert_filter(link, scale, 0, 0)) { | ||
| 85 | avfilter_destroy(scale); | 81 | avfilter_destroy(scale); |
| 86 | return -1; | 82 | return -1; |
| 87 | } | 83 | } |