diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-28 01:38:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-31 04:31:28 +0200 |
commit | 03637762d94cdd47b06c6311c8116edf9de73256 (patch) | |
tree | a662576404e8365d785e1f6dd227a07c1f503c37 /libavfilter | |
parent | 11aa050a2516e85dc2cc0bb27b7a6c3e9ec83dc6 (diff) | |
download | ffmpeg-03637762d94cdd47b06c6311c8116edf9de73256.tar.gz |
avfilter/vf_fade: Force alpha pixel format if alpha is set to 1
Fixes Ticket4321
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_fade.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index ab2dccf85b..3e6aa7fe87 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -115,12 +115,30 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; + static const enum AVPixelFormat pix_fmts_alpha[] = { + AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, + AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, + AV_PIX_FMT_NONE + }; + static const enum AVPixelFormat pix_fmts_rgba[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, + AV_PIX_FMT_NONE + }; AVFilterFormats *fmts_list; - if (s->black_fade) - fmts_list = ff_make_format_list(pix_fmts); - else - fmts_list = ff_make_format_list(pix_fmts_rgb); + if (s->alpha) { + if (s->black_fade) + fmts_list = ff_make_format_list(pix_fmts_alpha); + else + fmts_list = ff_make_format_list(pix_fmts_rgba); + } else { + if (s->black_fade) + fmts_list = ff_make_format_list(pix_fmts); + else + fmts_list = ff_make_format_list(pix_fmts_rgb); + } if (!fmts_list) return AVERROR(ENOMEM); return ff_set_common_formats(ctx, fmts_list); |