summaryrefslogtreecommitdiff
path: root/libavfilter/avfiltergraph.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-02-21 14:02:13 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-02-24 11:58:52 +0100
commit2d98dd3d142b5905852571a9c4c5d873945b2a37 (patch)
treeb951babb00a74f326f3b3be525dfc93a5fd8cb2f /libavfilter/avfiltergraph.c
parent3d7f4f87267cf260795f28de1f669c3f45e05a28 (diff)
lavfi: fix merging of formats and clarify exception.
The following commit: b97d61f avfilter/ff_merge_formats: only merge if doing so does not loose chroma or alpha introduced an exception to avoid lossy conversions. Add a comment to explain the logic. Fix the call to avoid applying it on audio formats.
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 0bc8464e1d..d0b6b1687f 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -272,8 +272,8 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
continue;
if (link->in_formats != link->out_formats &&
- !ff_merge_formats(link->in_formats,
- link->out_formats))
+ !ff_merge_formats(link->in_formats, link->out_formats,
+ link->type))
convert_needed = 1;
if (link->type == AVMEDIA_TYPE_AUDIO) {
if (link->in_channel_layouts != link->out_channel_layouts &&
@@ -337,8 +337,8 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
filter_query_formats(convert);
inlink = convert->inputs[0];
outlink = convert->outputs[0];
- if (!ff_merge_formats( inlink->in_formats, inlink->out_formats) ||
- !ff_merge_formats(outlink->in_formats, outlink->out_formats))
+ if (!ff_merge_formats( inlink->in_formats, inlink->out_formats, inlink->type) ||
+ !ff_merge_formats(outlink->in_formats, outlink->out_formats, outlink->type))
ret |= AVERROR(ENOSYS);
if (inlink->type == AVMEDIA_TYPE_AUDIO &&
(!ff_merge_samplerates(inlink->in_samplerates,