diff mbox series

[FFmpeg-devel,05/11] fftools/ffmpeg_filter: move InputFilter.eof to private data

Message ID 20230505090723.24872-5-anton@khirnov.net
State Accepted
Commit e8df737cb2305efb137e655e7f6dfd5e4c80bc5c
Headers show
Series [FFmpeg-devel,01/11] fftools/ffmpeg: merge choose_output() and got_eagain() | 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

Anton Khirnov May 5, 2023, 9:07 a.m. UTC
It is not used outside of ffmpeg_filter.
---
 fftools/ffmpeg.h        | 2 --
 fftools/ffmpeg_filter.c | 7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 525a00bfcb..0231ebc84f 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -292,8 +292,6 @@  typedef struct InputFilter {
 
     AVBufferRef *hw_frames_ctx;
     int32_t *displaymatrix;
-
-    int eof;
 } InputFilter;
 
 typedef struct OutputFilter {
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 3fad38f782..5d9242f476 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -55,6 +55,8 @@  static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
 typedef struct InputFilterPriv {
     InputFilter ifilter;
 
+    int eof;
+
     AVRational time_base;
 
     AVFifo *frame_queue;
@@ -1353,7 +1355,8 @@  int configure_filtergraph(FilterGraph *fg)
 
     /* send the EOFs for the finished inputs */
     for (i = 0; i < fg->nb_inputs; i++) {
-        if (fg->inputs[i]->eof) {
+        InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[i]);
+        if (ifp->eof) {
             ret = av_buffersrc_add_frame(fg->inputs[i]->filter, NULL);
             if (ret < 0)
                 goto fail;
@@ -1500,7 +1503,7 @@  int ifilter_send_eof(InputFilter *ifilter, int64_t pts, AVRational tb)
     InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
     int ret;
 
-    ifilter->eof = 1;
+    ifp->eof = 1;
 
     if (ifilter->filter) {
         pts = av_rescale_q_rnd(pts, tb, ifp->time_base,