From 01f63ef0b44fa70d87edaf52f19fcdb2ae7446b3 Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 27 Feb 2025 23:38:09 -0300 Subject: [PATCH] fftools/ffmpeg_filter: also remove display matrix side data from buffered frames Some frames may be buffered before a complex filtergraph can be configured. This change ensures the side data removal in the cases where autorotation is enabled also applies to them. Fixes ticket #11487 Signed-off-by: James Almer --- fftools/ffmpeg_filter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 800e2a3f06..cd8a4abc52 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -2041,6 +2041,10 @@ static int configure_filtergraph(FilterGraph *fg, FilterGraphThread *fgt) if (ifp->type_src == AVMEDIA_TYPE_SUBTITLE) { sub2video_frame(&ifp->ifilter, tmp, !fgt->graph); } else { + if (ifp->type_src == AVMEDIA_TYPE_VIDEO) { + if (ifp->displaymatrix_applied) + av_frame_remove_side_data(tmp, AV_FRAME_DATA_DISPLAYMATRIX); + } ret = av_buffersrc_add_frame(ifp->filter, tmp); } av_frame_free(&tmp);