summaryrefslogtreecommitdiff
path: root/libavfilter/avfiltergraph.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-06-13 10:10:31 +0200
committerAnton Khirnov <anton@khirnov.net>2012-06-13 13:57:47 +0200
commit2f296e39a17cd947c6675c20ff61a2d993ff0de2 (patch)
tree48381cb324a199ef704c34ec86d433a4bc6abe13 /libavfilter/avfiltergraph.c
parenta48802836261082be8fe3d809e9e788f50620536 (diff)
downloadffmpeg-2f296e39a17cd947c6675c20ff61a2d993ff0de2.tar.gz
lavfi: allow building without swscale.
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 4521f790f7..0a863e569c 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -213,11 +213,16 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
/* couldn't merge format lists. auto-insert conversion filter */
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
+ if (!(filter = avfilter_get_by_name("scale"))) {
+ av_log(log_ctx, AV_LOG_ERROR, "'scale' filter "
+ "not present, cannot convert pixel formats.\n");
+ return AVERROR(EINVAL);
+ }
+
snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
scaler_count++);
snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts);
- if ((ret = avfilter_graph_create_filter(&convert,
- avfilter_get_by_name("scale"),
+ if ((ret = avfilter_graph_create_filter(&convert, filter,
inst_name, scale_args, NULL,
graph)) < 0)
return ret;