Commit 6af046ca authored by Steve Lhomme's avatar Steve Lhomme
Browse files

filter_chain: drain pictures filtering in filter_chain_VideoFilter()

In the past the drained pictures were stored in chained_filter_t::pending. Now
they are either drained explicitly (filter_chain_VideoDrain) or dropped as
they used to before doing a new filter call.

Filtering with a NULL picture is no longer allowed.
parent 06d04158
...@@ -457,13 +457,22 @@ static picture_t *filter_chained( chained_filter_t *f, picture_t *p_pic ) ...@@ -457,13 +457,22 @@ static picture_t *filter_chained( chained_filter_t *f, picture_t *p_pic )
picture_t *filter_chain_VideoFilter( filter_chain_t *p_chain, picture_t *p_pic ) picture_t *filter_chain_VideoFilter( filter_chain_t *p_chain, picture_t *p_pic )
{ {
if( p_pic ) assert( p_pic != NULL );
for( chained_filter_t *f = p_chain->first; f != NULL; f = f->next )
{ {
p_pic = FilterChainVideoFilter( p_chain->first, p_pic ); picture_t *pending = filter_DrainVideo( &f->filter );
if( p_pic ) if (pending)
return p_pic; {
msg_Warn( &f->filter, "dropping pictures" );
do
{
picture_Release( pending );
pending = filter_DrainVideo( &f->filter );
} while (pending);
}
} }
return filter_chain_VideoDrain( p_chain );
return filter_chained( p_chain->first, p_pic );
} }
picture_t *filter_chain_VideoDrain( filter_chain_t *p_chain ) picture_t *filter_chain_VideoDrain( filter_chain_t *p_chain )
......
Supports Markdown
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