[vlc-commits] filter_chain: use the picture_chain API
Steve Lhomme
git at videolan.org
Wed Sep 23 16:17:50 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 17 16:34:49 2020 +0200| [1cea713b3fb271ab4f2184c0e42b1b8519f9a974] | committer: Steve Lhomme
filter_chain: use the picture_chain API
chained_filter_t::pending represents the picture chain coming from incoming
pictures. It is set using vlc_picture_chain_get_and_reset() which removes a whole
picture chain from a picture, unlike vlc_picture_chain_PopFront which pops only
one picture.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1cea713b3fb271ab4f2184c0e42b1b8519f9a974
---
src/misc/filter_chain.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 5465e0c608..645a27507f 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -437,8 +437,7 @@ static picture_t *FilterChainVideoFilter( chained_filter_t *f, picture_t *p_pic
msg_Warn( p_filter, "dropping pictures" );
FilterDeletePictures( f->pending );
}
- f->pending = p_pic->p_next;
- p_pic->p_next = NULL;
+ f->pending = picture_GetAndResetChain( p_pic );
}
return p_pic;
}
@@ -456,8 +455,7 @@ picture_t *filter_chain_VideoFilter( filter_chain_t *p_chain, picture_t *p_pic )
if( !b->pending )
continue;
p_pic = b->pending;
- b->pending = p_pic->p_next;
- p_pic->p_next = NULL;
+ b->pending = picture_GetAndResetChain( p_pic );
p_pic = FilterChainVideoFilter( b->next, p_pic );
if( p_pic )
@@ -535,8 +533,7 @@ static void FilterDeletePictures( picture_t *picture )
{
while( picture )
{
- picture_t *next = picture->p_next;
- picture_Release( picture );
- picture = next;
+ picture_t *next = vlc_picture_chain_PopFront( &picture );
+ picture_Release( next );
}
}
More information about the vlc-commits
mailing list