mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02: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
@ -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…
Reference in New Issue
Block a user