[FFmpeg-cvslog] fftools/ffmpeg: Repair reinit_filter feature

Michael Niedermayer git at videolan.org
Thu Mar 21 20:12:56 EET 2019


ffmpeg | branch: release/4.0 | Michael Niedermayer <michael at niedermayer.cc> | Tue Nov 13 20:29:40 2018 +0100| [dab6409d84a798a778d827e5fccaf618c3449acc] | committer: Michael Niedermayer

fftools/ffmpeg: Repair reinit_filter feature

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 35040048793bc5d19942277fe17d1235e915a7d8)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dab6409d84a798a778d827e5fccaf618c3449acc
---

 fftools/ffmpeg.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index c0214c42d8..d436a0e71c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2121,9 +2121,6 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
 
     /* determine if the parameters for this input changed */
     need_reinit = ifilter->format != frame->format;
-    if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
-        (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
-        need_reinit = 1;
 
     switch (ifilter->ist->st->codecpar->codec_type) {
     case AVMEDIA_TYPE_AUDIO:
@@ -2137,6 +2134,13 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
         break;
     }
 
+    if (!ifilter->ist->reinit_filters && fg->graph)
+        need_reinit = 0;
+
+    if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
+        (ifilter->hw_frames_ctx && ifilter->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)



More information about the ffmpeg-cvslog mailing list