mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
avfilter/vf_scale: require straight alpha for alpha blending
Fortunately, we only care if this flag is set - otherwise, this filter is alpha mode agnostic (since it is purely scaling, etc). That said, there is an argument to be made that we should prefer premul alpha when scaling, because scaling in straight alpha will leak garbage pixels; but I think that would be a too backwards-incompatible change to be worth thinking about at this time.
This commit is contained in:
@@ -520,6 +520,12 @@ static int query_formats(const AVFilterContext *ctx,
|
||||
if ((ret = ff_formats_ref(formats, &cfg_out[0]->color_ranges)) < 0)
|
||||
return ret;
|
||||
|
||||
if (scale->sws->alpha_blend) {
|
||||
if ((ret = ff_formats_ref(ff_make_formats_list_singleton(AVALPHA_MODE_STRAIGHT),
|
||||
&cfg_in[0]->alpha_modes)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user