diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-04-27 10:42:46 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-05-14 21:29:58 +0200 |
commit | 440af105f2306d3c7b3b3f4d7530bab910d49cb9 (patch) | |
tree | 9bcffc765646a1550b960c4b472af07d3f94ef04 /libavfilter/avfiltergraph.c | |
parent | 7e944159c63c4d4504cf76f90bb668519c3109af (diff) | |
download | ffmpeg-440af105f2306d3c7b3b3f4d7530bab910d49cb9.tar.gz |
lavfi: add avfilter_graph_set_auto_convert().
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r-- | libavfilter/avfiltergraph.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 6e803d6a55..3bc10f9586 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -95,6 +95,11 @@ fail: return ret; } +void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags) +{ + graph->disable_auto_convert = flags; +} + int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) { AVFilterContext *filt; @@ -160,6 +165,14 @@ static int insert_conv_filter(AVFilterGraph *graph, AVFilterLink *link, char inst_name[32]; AVFilterContext *filt_ctx; + if (graph->disable_auto_convert) { + av_log(NULL, AV_LOG_ERROR, + "The filters '%s' and '%s' do not have a common format " + "and automatic conversion is disabled.\n", + link->src->name, link->dst->name); + return AVERROR(EINVAL); + } + snprintf(inst_name, sizeof(inst_name), "auto-inserted %s %d", filt_name, auto_count++); |