mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
lavfi/vf_libplacebo: add RGB colorspace sanity
Explicitly forbid using a non-RGB colorspace with RGB pixel format or vice versa. This mirrors identical logic from vf_scale.
This commit is contained in:
parent
c00fd02558
commit
f66280182a
1 changed files with 7 additions and 0 deletions
|
|
@ -697,6 +697,13 @@ static int output_frame_mix(AVFilterContext *ctx,
|
|||
if (s->color_primaries >= 0)
|
||||
out->color_primaries = s->color_primaries;
|
||||
|
||||
/* Sanity colorspace overrides */
|
||||
if (outdesc->flags & AV_PIX_FMT_FLAG_RGB) {
|
||||
out->colorspace = AVCOL_SPC_RGB;
|
||||
} else if (out->colorspace == AVCOL_SPC_RGB) {
|
||||
out->colorspace = AVCOL_SPC_UNSPECIFIED;
|
||||
}
|
||||
|
||||
changed_csp = ref->colorspace != out->colorspace ||
|
||||
ref->color_range != out->color_range ||
|
||||
ref->color_trc != out->color_trc ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue