[vlc-devel] [PATCH 16/34] filter_chain: remove always NULL parameter from AppendFilter

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 8 15:40:20 CET 2019


---
 include/vlc_filter.h                 | 3 +--
 modules/stream_out/transcode/video.c | 4 ++--
 modules/video_chroma/chain.c         | 4 ++--
 src/misc/filter_chain.c              | 7 +++----
 src/video_output/video_output.c      | 2 +-
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index fc09f8654ab..6cc923e9d04 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -369,12 +369,11 @@ VLC_API void filter_chain_Clear(filter_chain_t *);
  *
  * \param chain filter chain to append a filter to
  * \param name filter name
- * \param fmt_in filter input format
  * \param fmt_out filter output format
  * \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 es_format_t *fmt_in,
+    const char *name, config_chain_t *cfg,
     const es_format_t *fmt_out);
 
 /**
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 6891e2b49c1..9f5a7941ef8 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -338,13 +338,13 @@ static int transcode_video_filters_init( sout_stream_t *p_stream,
         filter_chain_AppendFilter( id->p_f_chain,
                                    p_cfg->video.psz_deinterlace,
                                    p_cfg->video.p_deinterlace_cfg,
-                                   NULL, p_src );
+                                   p_src );
         p_src = filter_chain_GetFmtOut( id->p_f_chain );
     }
 
     if( b_master_sync )
     {
-        filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, NULL, p_dst );
+        filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, p_dst );
         p_src = filter_chain_GetFmtOut( id->p_f_chain );
     }
 
diff --git a/modules/video_chroma/chain.c b/modules/video_chroma/chain.c
index 9f4bd9f4387..ab523397a2e 100644
--- a/modules/video_chroma/chain.c
+++ b/modules/video_chroma/chain.c
@@ -395,7 +395,7 @@ static int BuildFilterChain( filter_t *p_filter )
             p_sys->p_video_filter =
                 filter_chain_AppendFilter( p_sys->p_chain,
                                            p_filter->psz_name, p_filter->p_cfg,
-                                           NULL, &fmt_mid );
+                                           &fmt_mid );
             if( p_sys->p_video_filter )
             {
                 filter_AddProxyCallbacks( p_filter,
@@ -532,7 +532,7 @@ static filter_t * AppendTransform( filter_chain_t *p_chain, const es_format_t *p
     snprintf( config, 100, "transform{type=%s}", type );
     char *next = config_ChainCreate( &name, &cfg, config );
 
-    filter_t *p_filter = filter_chain_AppendFilter( p_chain, name, cfg, NULL, p_fmt2 );
+    filter_t *p_filter = filter_chain_AppendFilter( p_chain, name, cfg, p_fmt2 );
 
     config_ChainDestroy(cfg);
     free(name);
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 927a0ba8524..55af4afd54d 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -271,10 +271,10 @@ error:
 
 filter_t *filter_chain_AppendFilter( filter_chain_t *chain,
     const char *name, config_chain_t *cfg,
-    const es_format_t *fmt_in, const es_format_t *fmt_out )
+    const es_format_t *fmt_out )
 {
     return filter_chain_AppendInner( chain, name, chain->filter_cap, cfg,
-                                     fmt_in, fmt_out );
+                                     NULL, fmt_out );
 }
 
 int filter_chain_AppendConverter( filter_chain_t *chain,
@@ -335,8 +335,7 @@ int filter_chain_AppendFromString( filter_chain_t *chain, const char *str )
         free( buf );
         buf = next;
 
-        filter_t *filter = filter_chain_AppendFilter( chain, name, cfg,
-                                                      NULL, NULL );
+        filter_t *filter = filter_chain_AppendFilter( chain, name, cfg, NULL );
         if( cfg )
             config_ChainDestroy( cfg );
 
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 6cb46d010a1..7aa3c38d658 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -828,7 +828,7 @@ static void ThreadChangeFilters(vout_thread_t *vout,
             vout_filter_t *e = vlc_array_item_at_index(array, i);
             msg_Dbg(vout, "Adding '%s' as %s", e->name, a == 0 ? "static" : "interactive");
             filter_t *filter = filter_chain_AppendFilter(chain, e->name, e->cfg,
-                               NULL, NULL);
+                               NULL);
             if (!filter)
             {
                 msg_Err(vout, "Failed to add filter '%s'", e->name);
-- 
2.17.1



More information about the vlc-devel mailing list