Showing the changes to libavfilter/avfiltergraph.c (1 of 4 files). Show all
Unified · Split
| @@ -213,11 +213,16 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 212 unmodified lines | |||
| 213 | /* couldn't merge format lists. auto-insert conversion filter */ | 213 | /* couldn't merge format lists. auto-insert conversion filter */ |
| 214 | switch (link->type) { | 214 | switch (link->type) { |
| 215 | case AVMEDIA_TYPE_VIDEO: | 215 | case AVMEDIA_TYPE_VIDEO: |
| 216 | if (!(filter = avfilter_get_by_name("scale"))) { | ||
| 217 | av_log(log_ctx, AV_LOG_ERROR, "'scale' filter " | ||
| 218 | "not present, cannot convert pixel formats.\n"); | ||
| 219 | return AVERROR(EINVAL); | ||
| 220 | } | ||
| 221 | |||
| 216 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", | 222 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", |
| 217 | scaler_count++); | 223 | scaler_count++); |
| 218 | snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); | 224 | snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); |
| 219 | if ((ret = avfilter_graph_create_filter(&convert, | 225 | if ((ret = avfilter_graph_create_filter(&convert, filter, |
| 220 | avfilter_get_by_name("scale"), | ||
| 221 | inst_name, scale_args, NULL, | 226 | inst_name, scale_args, NULL, |
| 222 | graph)) < 0) | 227 | graph)) < 0) |
| 223 | return ret; | 228 | return ret; |