[FFmpeg-cvslog] avfilter/vf_zscale: strip metadata on change
Niklas Haas
git at videolan.org
Mon Dec 23 15:23:30 EET 2024
ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Fri Apr 26 12:59:37 2024 +0200| [d1eadc43b91a84ddf6ae5d130b4752e9a36d0a92] | committer: Niklas Haas
avfilter/vf_zscale: strip metadata on change
Required for both size changes and color volume changes (as a result of
changing primaries/transfer).
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1eadc43b91a84ddf6ae5d130b4752e9a36d0a92
---
libavfilter/vf_zscale.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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;
More information about the ffmpeg-cvslog
mailing list