diff options
author | Niklas Haas <git@haasn.dev> | 2024-04-26 12:59:37 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2024-12-23 14:23:13 +0100 |
commit | d1eadc43b91a84ddf6ae5d130b4752e9a36d0a92 (patch) | |
tree | 176b116b941d05b22631d5cf2e322ffaaf7114ea | |
parent | f22965b8823c92b16c645e7ef5a0ef95b81c7821 (diff) | |
download | ffmpeg-d1eadc43b91a84ddf6ae5d130b4752e9a36d0a92.tar.gz |
avfilter/vf_zscale: strip metadata on change
Required for both size changes and color volume changes (as a result of
changing primaries/transfer).
-rw-r--r-- | libavfilter/vf_zscale.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c index e456053b4e..569d0382ca 100644 --- a/libavfilter/vf_zscale.c +++ b/libavfilter/vf_zscale.c @@ -781,7 +781,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format); const AVPixFmtDescriptor *odesc = av_pix_fmt_desc_get(outlink->format); char buf[32]; - int ret = 0; + int ret = 0, changed = 0; AVFrame *out = NULL; ThreadData td; @@ -875,6 +875,12 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h, INT_MAX); + if (out->width != in->width || out->height != in->height) + changed |= AV_SIDE_DATA_PROP_SIZE_DEPENDENT; + if (out->color_trc != in->color_trc || out->color_primaries != in->color_primaries) + changed |= AV_SIDE_DATA_PROP_COLOR_DEPENDENT; + av_frame_side_data_remove_by_props(&out->side_data, &out->nb_side_data, changed); + td.in = in; td.out = out; td.desc = desc; |