Commit 5f164b8a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

filter_chain: remove useless length member

parent 9f74ef90
...@@ -58,7 +58,6 @@ struct filter_chain_t ...@@ -58,7 +58,6 @@ struct filter_chain_t
es_format_t fmt_in; /**< Chain input format (constant) */ es_format_t fmt_in; /**< Chain input format (constant) */
es_format_t fmt_out; /**< Chain current output format */ 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? */ bool b_allow_fmt_out_change; /**< Can the output format be changed? */
const char *filter_cap; /**< Filter modules capability */ const char *filter_cap; /**< Filter modules capability */
const char *conv_cap; /**< Converter 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, ...@@ -87,7 +86,6 @@ static filter_chain_t *filter_chain_NewInner( const filter_owner_t *callbacks,
chain->last = NULL; chain->last = NULL;
es_format_Init( &chain->fmt_in, cat, 0 ); es_format_Init( &chain->fmt_in, cat, 0 );
es_format_Init( &chain->fmt_out, cat, 0 ); es_format_Init( &chain->fmt_out, cat, 0 );
chain->length = 0;
chain->b_allow_fmt_out_change = fmt_out_change; chain->b_allow_fmt_out_change = fmt_out_change;
chain->filter_cap = cap; chain->filter_cap = cap;
chain->conv_cap = conv_cap; chain->conv_cap = conv_cap;
...@@ -243,7 +241,6 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain, ...@@ -243,7 +241,6 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
chained->prev = chain->last; chained->prev = chain->last;
chain->last = chained; chain->last = chained;
chained->next = NULL; chained->next = NULL;
chain->length++;
vlc_mouse_t *mouse = malloc( sizeof(*mouse) ); vlc_mouse_t *mouse = malloc( sizeof(*mouse) );
if( likely(mouse != NULL) ) if( likely(mouse != NULL) )
...@@ -304,9 +301,6 @@ void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter ) ...@@ -304,9 +301,6 @@ void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )
chain->last = chained->prev; chain->last = chained->prev;
} }
assert( chain->length > 0 );
chain->length--;
module_unneed( filter, filter->p_module ); module_unneed( filter, filter->p_module );
msg_Dbg( obj, "Filter %p removed from chain", (void *)filter ); msg_Dbg( obj, "Filter %p removed from chain", (void *)filter );
...@@ -381,7 +375,7 @@ int filter_chain_ForEach( filter_chain_t *chain, ...@@ -381,7 +375,7 @@ int filter_chain_ForEach( filter_chain_t *chain,
bool filter_chain_IsEmpty(const 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 ) const es_format_t *filter_chain_GetFmtOut( filter_chain_t *p_chain )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment