History

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.

Niklas Haas committed 3 years ago

Commit f6628011 parent c00fd021 file · +7 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_libplacebo.c+7−0
@@ -697,6 +697,13 @@ static int output_frame_mix(AVFilterContext *ctx, · 696 unmodified lines
697 if (s->color_primaries >= 0)697 if (s->color_primaries >= 0)
698 out->color_primaries = s->color_primaries;698 out->color_primaries = s->color_primaries;
699 699
700 /* Sanity colorspace overrides */
701 if (outdesc->flags & AV_PIX_FMT_FLAG_RGB) {
702 out->colorspace = AVCOL_SPC_RGB;
703 } else if (out->colorspace == AVCOL_SPC_RGB) {
704 out->colorspace = AVCOL_SPC_UNSPECIFIED;
705 }
706
700 changed_csp = ref->colorspace != out->colorspace ||707 changed_csp = ref->colorspace != out->colorspace ||
701 ref->color_range != out->color_range ||708 ref->color_range != out->color_range ||
702 ref->color_trc != out->color_trc ||709 ref->color_trc != out->color_trc ||

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t