[vlc-devel] [PATCH 1/2] filter: constify config_chain_t parameter

Romain Vimont rom1v at videolabs.io
Mon Feb 22 17:00:08 UTC 2021


As explained by 758052fa4434be65ceb0d48db485a9ec80d930c7, a filter does
not take ownership of the config_chain_t instance, and never needs a
non-const pointer.
---
 include/vlc_filter.h    | 4 ++--
 src/misc/filter_chain.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index 9d5e3541a4..91cfd9f6ce 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -231,7 +231,7 @@ struct filter_t
     /* Name of the "video filter" shortcut that is requested, can be NULL */
     const char *        psz_name;
     /* Filter configuration */
-    config_chain_t *    p_cfg;
+    const config_chain_t *p_cfg;
 
     /* Implementation of filter API */
     const struct vlc_filter_operations *ops;
@@ -529,7 +529,7 @@ VLC_API void filter_chain_Clear(filter_chain_t *);
  * \return a pointer to the filter or NULL on error
  */
 VLC_API filter_t *filter_chain_AppendFilter(filter_chain_t *chain,
-    const char *name, config_chain_t *cfg,
+    const char *name, const config_chain_t *cfg,
     const es_format_t *fmt_out);
 
 /**
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 82068f3ff2..58ef23e027 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -204,7 +204,7 @@ void filter_chain_Reset( filter_chain_t *p_chain,
 }
 
 static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
-    const char *name, const char *capability, config_chain_t *cfg,
+    const char *name, const char *capability, const config_chain_t *cfg,
     const es_format_t *fmt_out )
 {
     chained_filter_t *chained =
@@ -293,7 +293,7 @@ error:
 }
 
 filter_t *filter_chain_AppendFilter( filter_chain_t *chain,
-    const char *name, config_chain_t *cfg,
+    const char *name, const config_chain_t *cfg,
     const es_format_t *fmt_out )
 {
     return filter_chain_AppendInner( chain, name, chain->filter_cap, cfg,
-- 
2.30.1



More information about the vlc-devel mailing list