[vlc-devel] [PATCH 21/22] mmal: deinterlace: use the picture_chain API

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


Received pictures are chained in ret_pics, first directly then through the
chain_tail local variable which keeps track of the tail of the picture chain.
---
 modules/hw/mmal/deinterlace.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index 6cd5974d37c..2512095b4ca 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -263,7 +263,7 @@ static picture_t *deinterlace(filter_t * p_filter, picture_t * p_pic)
 
     // Return anything that is in the out Q
     {
-        picture_t ** pp_pic = &ret_pics;
+        picture_t * chain_tail = ret_pics;
 
         // Advanced di has a 3 frame latency, so if the seq delta is greater
         // than that then we are expecting at least two frames of output. Wait
@@ -289,8 +289,13 @@ static picture_t *deinterlace(filter_t * p_filter, picture_t * p_pic)
             }
             out_buf = NULL;  // Now attached to pic or recycled
 
-            *pp_pic = out_pic;
-            pp_pic = &out_pic->p_next;
+            if (ret_pics == NULL)
+            {
+                ret_pics = out_pic;
+                chain_tail = out_pic;
+            }
+            else
+                chain_tail = picture_chain_append( chain_tail, out_pic );
 
             // Ignore 0 seqs
             // Don't think these should actually happen
-- 
2.26.2



More information about the vlc-devel mailing list