diff mbox series

[FFmpeg-devel,2/3] fftools/ffmpeg_filter: honor -reinit_filters 0 even on changed display matrix

Message ID 20231229185059.18462-2-cus@passwd.hu
State Accepted
Commit 324be730fce5d0e96bcdec9ec5d09551ec7ffd60
Headers show
Series [FFmpeg-devel,1/3] all: use av_channel_layout_describe_bprint instead of av_channel_layout_describe in a few places | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marton Balint Dec. 29, 2023, 6:50 p.m. UTC
Not sure about honoring it also in case of a hwaccel change, so left that as is
for now.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 fftools/ffmpeg_filter.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index c1c3014453..680fffb060 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -2607,13 +2607,6 @@  static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
         break;
     }
 
-    if (!ifp->ist->reinit_filters && fgt->graph)
-        need_reinit = 0;
-
-    if (!!ifp->hw_frames_ctx != !!frame->hw_frames_ctx ||
-        (ifp->hw_frames_ctx && ifp->hw_frames_ctx->data != frame->hw_frames_ctx->data))
-        need_reinit = 1;
-
     if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) {
         if (!ifp->displaymatrix_present ||
             memcmp(sd->data, ifp->displaymatrix, sizeof(ifp->displaymatrix)))
@@ -2621,6 +2614,13 @@  static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
     } else if (ifp->displaymatrix_present)
         need_reinit = 1;
 
+    if (!ifp->ist->reinit_filters && fgt->graph)
+        need_reinit = 0;
+
+    if (!!ifp->hw_frames_ctx != !!frame->hw_frames_ctx ||
+        (ifp->hw_frames_ctx && ifp->hw_frames_ctx->data != frame->hw_frames_ctx->data))
+        need_reinit = 1;
+
     if (need_reinit) {
         ret = ifilter_parameters_from_frame(ifilter, frame);
         if (ret < 0)