[vlc-devel] [PATCH 06/22] filter_chain: use the picture_chain API

Steve Lhomme robux4 at ycbcr.xyz
Thu Sep 17 17:33:28 CEST 2020


chained_filter_t::pending represents the picture chain coming from incoming
pictures. It is set using picture_pop_chain() which removes a whole picture
chain from a picture, unlike picture_chain_pop_front which pops only one
picture.
---
 src/misc/filter_chain.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 5465e0c608c..3c35305245b 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_pop_chain( p_pic );
     }
     return p_pic;
 }
@@ -455,9 +454,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;
+        p_pic = picture_chain_pop_front( &b->pending );
 
         p_pic = FilterChainVideoFilter( b->next, p_pic );
         if( p_pic )
@@ -535,8 +532,7 @@ static void FilterDeletePictures( picture_t *picture )
 {
     while( picture )
     {
-        picture_t *next = picture->p_next;
-        picture_Release( picture );
-        picture = next;
+        picture_t *next = picture_chain_pop_front( &picture );
+        picture_Release( next );
     }
 }
-- 
2.26.2



More information about the vlc-devel mailing list