Commit 7671ac4e12 for ffmpeg
commit 7671ac4e128c5f12ad6e5f404aa6c2ca8e63e6f3
Author: Niklas Haas <git@haasn.dev>
Date: Fri Oct 30 16:41:50 2026 +0100
avfilter/vf_libplacebo: make the reference frame optional in set_output_props()
Without a reference frame, only the properties derived from the output link
and the filter options are set.
Note that the conditional stripping flags (including `progressive`) are
only needed if we are copying from the ref frame; as a plain allocated
AVFrame would never have this side data / flags otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 241a1eb462..5fa9dd4a9f 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -993,15 +993,17 @@ static int set_output_props(LibplaceboContext *s, const AVFilterLink *outlink,
{
int err, changed = 0;
- if ((err = av_frame_copy_props(out, ref)) < 0)
- return err;
+ if (ref) {
+ if ((err = av_frame_copy_props(out, ref)) < 0)
+ return err;
- if (s->apply_dovi && av_frame_get_side_data(ref, AV_FRAME_DATA_DOVI_METADATA)) {
- /* Output of dovi reshaping is always BT.2020+PQ, so infer the correct
- * output colorspace defaults */
- out->color_primaries = AVCOL_PRI_BT2020;
- out->color_trc = AVCOL_TRC_SMPTE2084;
- changed |= AV_SIDE_DATA_PROP_COLOR_DEPENDENT;
+ if (s->apply_dovi && av_frame_get_side_data(ref, AV_FRAME_DATA_DOVI_METADATA)) {
+ /* Output of dovi reshaping is always BT.2020+PQ, so infer the correct
+ * output colorspace defaults */
+ out->color_primaries = AVCOL_PRI_BT2020;
+ out->color_trc = AVCOL_TRC_SMPTE2084;
+ changed |= AV_SIDE_DATA_PROP_COLOR_DEPENDENT;
+ }
}
out->width = outlink->w;
@@ -1017,6 +1019,9 @@ static int set_output_props(LibplaceboContext *s, const AVFilterLink *outlink,
if (s->color_primaries >= 0)
out->color_primaries = s->color_primaries;
+ if (!ref)
+ return 0;
+
/* Strip side data if no longer relevant */
if (out->width != ref->width || out->height != ref->height)
changed |= AV_SIDE_DATA_PROP_SIZE_DEPENDENT;