diff mbox series

[FFmpeg-devel,03/13] fftools/ffmpeg_filter: track input/output index in {Input, Output}FilterPriv

Message ID 20231123191524.11296-5-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/13] lavfi/buffersink: avoid leaking peeked_frame on uninit | 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 Nov. 23, 2023, 7:14 p.m. UTC
Will be useful in following commits.
---
 fftools/ffmpeg_filter.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index b6fbc5b195..f942c97c40 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -74,6 +74,8 @@  static const FilterGraphPriv *cfgp_from_cfg(const FilterGraph *fg)
 typedef struct InputFilterPriv {
     InputFilter ifilter;
 
+    int              index;
+
     AVFilterContext *filter;
 
     InputStream *ist;
@@ -162,6 +164,8 @@  typedef struct FPSConvContext {
 typedef struct OutputFilterPriv {
     OutputFilter        ofilter;
 
+    int                 index;
+
     AVFilterContext    *filter;
 
     /* desired output stream properties */
@@ -594,6 +598,7 @@  static OutputFilter *ofilter_alloc(FilterGraph *fg)
     ofilter           = &ofp->ofilter;
     ofilter->graph    = fg;
     ofp->format       = -1;
+    ofp->index        = fg->nb_outputs - 1;
     ofilter->last_pts = AV_NOPTS_VALUE;
 
     return ofilter;
@@ -787,6 +792,7 @@  static InputFilter *ifilter_alloc(FilterGraph *fg)
     if (!ifp->frame)
         return NULL;
 
+    ifp->index           = fg->nb_inputs - 1;
     ifp->format          = -1;
     ifp->fallback.format = -1;