diff mbox series

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

Message ID 20231104092125.10213-10-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/24] lavf/mux: do not apply max_interleave_delta to subtitles | expand

Commit Message

Anton Khirnov Nov. 4, 2023, 7:56 a.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 d48974581b..4edf634b26 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;