[vlc-devel] [PATCH 11/34] filter_chain: no need to reset the fmt_out each time a filter is added

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


The last output format is always the format of the last filter. It doesn't
matter if it was allowed to change the format or not. It's either the filter
added or the "chain" filter added to compensate for the format change (should
be adjusted in push mode)

If there's no filter yet, the output format is the one used to initialize the
filter chain.
---
 src/misc/filter_chain.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 3739a457200..6e6674586c1 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -51,7 +51,7 @@ struct filter_chain_t
     chained_filter_t *first, *last; /**< List of filters */
 
     es_format_t fmt_in; /**< Chain input format (constant) */
-    es_format_t fmt_out; /**< Chain current output format */
+    es_format_t fmt_out; /**< Chain output format (constant) */
     bool b_allow_fmt_out_change; /**< Each filter can change the output */
     const char *filter_cap; /**< Filter modules capability */
     const char *conv_cap; /**< Converter modules capability */
@@ -236,12 +236,6 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
     if( filter->p_module == NULL )
         goto error;
 
-    if( chain->b_allow_fmt_out_change )
-    {
-        es_format_Clean( &chain->fmt_out );
-        es_format_Copy( &chain->fmt_out, &filter->fmt_out );
-    }
-
     if( chain->last == NULL )
     {
         assert( chain->first == NULL );
@@ -389,9 +383,6 @@ bool filter_chain_IsEmpty(const filter_chain_t *chain)
 
 const es_format_t *filter_chain_GetFmtOut( const filter_chain_t *p_chain )
 {
-    if( p_chain->b_allow_fmt_out_change )
-        return &p_chain->fmt_out;
-
     if( p_chain->last != NULL )
         return &p_chain->last->filter.fmt_out;
 
-- 
2.17.1



More information about the vlc-devel mailing list