[vlc-commits] filter_chain: remove useless length member

Rémi Denis-Courmont git at videolan.org
Wed Jul 26 20:32:36 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 26 21:26:52 2017 +0300| [5f164b8a6ead6e1be6f4e16a1d9b7b3c414d0bd8] | committer: Rémi Denis-Courmont

filter_chain: remove useless length member

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5f164b8a6ead6e1be6f4e16a1d9b7b3c414d0bd8
---

 src/misc/filter_chain.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 3e7d4fb08f..552ed9e587 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -58,7 +58,6 @@ struct filter_chain_t
 
     es_format_t fmt_in; /**< Chain input format (constant) */
     es_format_t fmt_out; /**< Chain current output format */
-    unsigned length; /**< Number of filters */
     bool b_allow_fmt_out_change; /**< Can the output format be changed? */
     const char *filter_cap; /**< Filter modules capability */
     const char *conv_cap; /**< Converter modules capability */
@@ -87,7 +86,6 @@ static filter_chain_t *filter_chain_NewInner( const filter_owner_t *callbacks,
     chain->last = NULL;
     es_format_Init( &chain->fmt_in, cat, 0 );
     es_format_Init( &chain->fmt_out, cat, 0 );
-    chain->length = 0;
     chain->b_allow_fmt_out_change = fmt_out_change;
     chain->filter_cap = cap;
     chain->conv_cap = conv_cap;
@@ -243,7 +241,6 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
     chained->prev = chain->last;
     chain->last = chained;
     chained->next = NULL;
-    chain->length++;
 
     vlc_mouse_t *mouse = malloc( sizeof(*mouse) );
     if( likely(mouse != NULL) )
@@ -304,9 +301,6 @@ void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )
         chain->last = chained->prev;
     }
 
-    assert( chain->length > 0 );
-    chain->length--;
-
     module_unneed( filter, filter->p_module );
 
     msg_Dbg( obj, "Filter %p removed from chain", (void *)filter );
@@ -381,7 +375,7 @@ int filter_chain_ForEach( filter_chain_t *chain,
 
 bool filter_chain_IsEmpty(const filter_chain_t *chain)
 {
-    return chain->length == 0;
+    return chain->first == NULL;
 }
 
 const es_format_t *filter_chain_GetFmtOut( filter_chain_t *p_chain )



More information about the vlc-commits mailing list