mirror of https://git.ffmpeg.org/ffmpeg.git
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)
|
if (s->color_primaries >= 0)
|
||||||
out->color_primaries = s->color_primaries;
|
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 ||
|
changed_csp = ref->colorspace != out->colorspace ||
|
||||||
ref->color_range != out->color_range ||
|
ref->color_range != out->color_range ||
|
||||||
ref->color_trc != out->color_trc ||
|
ref->color_trc != out->color_trc ||
|
||||||
|
|
Loading…
Reference in New Issue