diff mbox series

[FFmpeg-devel,6/8] avfilter/avfilter: Move init_state to FilterLinkInternal

Message ID AS8P250MB07443FA079237CB98E536EAE8F4E2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,1/8] avfilter/avfilter: Avoid allocation for AVFilterInternal | 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

Andreas Rheinhardt Feb. 14, 2024, 5:25 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/avfilter.c      | 7 ++++---
 libavfilter/avfilter.h      | 7 -------
 libavfilter/link_internal.h | 7 +++++++
 3 files changed, 11 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 796ec29afd..a3f8c403c3 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -323,6 +323,7 @@  int avfilter_config_links(AVFilterContext *filter)
     for (i = 0; i < filter->nb_inputs; i ++) {
         AVFilterLink *link = filter->inputs[i];
         AVFilterLink *inlink;
+        FilterLinkInternal *li = ff_link_internal(link);
 
         if (!link) continue;
         if (!link->src || !link->dst) {
@@ -335,14 +336,14 @@  int avfilter_config_links(AVFilterContext *filter)
         link->current_pts =
         link->current_pts_us = AV_NOPTS_VALUE;
 
-        switch (link->init_state) {
+        switch (li->init_state) {
         case AVLINK_INIT:
             continue;
         case AVLINK_STARTINIT:
             av_log(filter, AV_LOG_INFO, "circular filter chain detected\n");
             return 0;
         case AVLINK_UNINIT:
-            link->init_state = AVLINK_STARTINIT;
+            li->init_state = AVLINK_STARTINIT;
 
             if ((ret = avfilter_config_links(link->src)) < 0)
                 return ret;
@@ -413,7 +414,7 @@  int avfilter_config_links(AVFilterContext *filter)
                     return ret;
                 }
 
-            link->init_state = AVLINK_INIT;
+            li->init_state = AVLINK_INIT;
         }
     }
 
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 1d2909e28d..5c6e34e8fc 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -611,13 +611,6 @@  struct AVFilterLink {
      */
     AVFilterFormatsConfig outcfg;
 
-    /** stage of the initialization of the link properties (dimensions, etc) */
-    enum {
-        AVLINK_UNINIT = 0,      ///< not started
-        AVLINK_STARTINIT,       ///< started, but incomplete
-        AVLINK_INIT             ///< complete
-    } init_state;
-
     /**
      * Graph the filter belongs to.
      */
diff --git a/libavfilter/link_internal.h b/libavfilter/link_internal.h
index b5a8ac89ec..030eb24765 100644
--- a/libavfilter/link_internal.h
+++ b/libavfilter/link_internal.h
@@ -59,6 +59,13 @@  typedef struct FilterLinkInternal {
      * corresponding code.
      */
     int status_out;
+
+    /** stage of the initialization of the link properties (dimensions, etc) */
+    enum {
+        AVLINK_UNINIT = 0,      ///< not started
+        AVLINK_STARTINIT,       ///< started, but incomplete
+        AVLINK_INIT             ///< complete
+    } init_state;
 } FilterLinkInternal;
 
 static inline FilterLinkInternal *ff_link_internal(AVFilterLink *link)