[FFmpeg-devel] [PATCH 01/23] fftools/ffmpeg: drop InputStream.processing_needed

Anton Khirnov anton at khirnov.net
Sat Mar 25 21:15:07 EET 2023


It is equivalent to !InputStream.discard.
---
 fftools/ffmpeg.c          | 4 ++--
 fftools/ffmpeg.h          | 1 -
 fftools/ffmpeg_filter.c   | 1 -
 fftools/ffmpeg_mux_init.c | 3 ---
 4 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 438bee8fef..aa9284ecd5 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3648,7 +3648,7 @@ static void decode_flush(InputFile *ifile)
         InputStream *ist = ifile->streams[i];
         int ret;
 
-        if (!ist->processing_needed)
+        if (ist->discard)
             continue;
 
         do {
@@ -3793,7 +3793,7 @@ static int process_input(int file_index)
 
         for (i = 0; i < ifile->nb_streams; i++) {
             ist = ifile->streams[i];
-            if (ist->processing_needed) {
+            if (!ist->discard) {
                 ret = process_input_packet(ist, NULL, 0);
                 if (ret>0)
                     return 0;
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 823218e214..791deedc07 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -342,7 +342,6 @@ typedef struct InputStream {
     int decoding_needed;     /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
 #define DECODING_FOR_OST    1
 #define DECODING_FOR_FILTER 2
-    int processing_needed;   /* non zero if the packets must be processed */
     // should attach FrameData as opaque_ref after decoding
     int want_frame_data;
 
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 4fde120067..314b89b585 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -296,7 +296,6 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
 
     ist->discard         = 0;
     ist->decoding_needed |= DECODING_FOR_FILTER;
-    ist->processing_needed = 1;
     ist->st->discard = AVDISCARD_NONE;
 
     ifilter = ALLOC_ARRAY_ELEM(fg->inputs, fg->nb_inputs);
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 09d24ba8e5..ebc17059f9 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -2283,7 +2283,6 @@ int of_open(const OptionsContext *o, const char *filename)
         if (ost->enc_ctx && ost->ist) {
             InputStream *ist = ost->ist;
             ist->decoding_needed |= DECODING_FOR_OST;
-            ist->processing_needed = 1;
 
             if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
                 ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
@@ -2294,8 +2293,6 @@ int of_open(const OptionsContext *o, const char *filename)
                     exit_program(1);
                 }
             }
-        } else if (ost->ist) {
-            ost->ist->processing_needed = 1;
         }
 
         /* set the filter output constraints */
-- 
2.39.1



More information about the ffmpeg-devel mailing list