Commit b2813dedac for ffmpeg
commit b2813dedac092791480e5f5d23db007679936892
Author: James Almer <jamrial@gmail.com>
Date: Wed Oct 7 13:52:28 2026 -0300
fftools/ffmpeg_filter: copy global side data to frames when the source graph is internal
Signed-off-by: James Almer <jamrial@gmail.com>
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index a0a6e082b3..54ba036d7c 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -2908,6 +2908,7 @@ static int fg_output_step(OutputFilterPriv *ofp, FilterGraphThread *fgt,
AVFrame *frame)
{
FilterGraphPriv *fgp = fgp_from_fg(ofp->ofilter.graph);
+ FilterGraph *fg = &fgp->fg;
AVFilterContext *filter = ofp->ofilter.filter;
FrameData *fd;
int ret;
@@ -2964,6 +2965,20 @@ static int fg_output_step(OutputFilterPriv *ofp, FilterGraphThread *fgt,
}
}
+ // Copy global side data to the output frame for the cases the
+ // filtergraph is internal (e.g. created to merge a Tile Grid)
+ // which don't come from a decoder that would have already
+ // copied said side data from the global decoder context.
+ if (fg->is_internal) {
+ ret = clone_side_data(&frame->side_data, &frame->nb_side_data,
+ ofp->side_data, ofp->nb_side_data,
+ AV_FRAME_SIDE_DATA_FLAG_REPLACE);
+ if (ret < 0 && ret != AVERROR(EEXIST)) {
+ av_frame_unref(frame);
+ return ret;
+ }
+ }
+
fd->wallclock[LATENCY_PROBE_FILTER_POST] = av_gettime_relative();
// only use bits_per_raw_sample passed through from the decoder