[vlc-commits] mosaic: use the picture_chain API

Steve Lhomme git at videolan.org
Wed Sep 23 16:17:48 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 17 15:07:51 2020 +0200| [cd883edd54f841ff91a25e4e2f26a0acbfdf6eb8] | committer: Steve Lhomme

mosaic: use the picture_chain API

p_es->p_picture represents the picture chain and p_es->chain_tail the tail that
is used to append pictures.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd883edd54f841ff91a25e4e2f26a0acbfdf6eb8
---

 modules/spu/mosaic.c               |  7 +++----
 modules/stream_out/mosaic_bridge.c | 13 +++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/spu/mosaic.c b/modules/spu/mosaic.c
index 1b9a1ee8c7..deecc74e73 100644
--- a/modules/spu/mosaic.c
+++ b/modules/spu/mosaic.c
@@ -532,11 +532,10 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
         while ( p_es->p_picture != NULL
                  && p_es->p_picture->date + p_sys->i_delay < date )
         {
-            if ( p_es->p_picture->p_next != NULL )
+            if ( picture_HasChainedPics( p_es->p_picture ) )
             {
-                picture_t *p_next = p_es->p_picture->p_next;
-                picture_Release( p_es->p_picture );
-                p_es->p_picture = p_next;
+                picture_t *es_picture = vlc_picture_chain_PopFront( &p_es->p_picture );
+                picture_Release( es_picture );
             }
             else if ( p_es->p_picture->date + p_sys->i_delay + BLANK_DELAY <
                         date )
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index bf05c16a08..daa7ee4ddf 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -462,9 +462,8 @@ static void Del( sout_stream_t *p_stream, void *id )
     p_es->b_empty = true;
     while ( p_es->p_picture )
     {
-        picture_t *p_next = p_es->p_picture->p_next;
-        picture_Release( p_es->p_picture );
-        p_es->p_picture = p_next;
+        picture_t *es_picture = vlc_picture_chain_PopFront( &p_es->p_picture );
+        picture_Release( es_picture );
     }
 
     for ( i = 0; i < p_bridge->i_es_num; i++ )
@@ -572,11 +571,13 @@ static void decoder_queue_video( decoder_t *p_dec, picture_t *p_pic )
     bridged_es_t *p_es = p_sys->p_es;
     vlc_global_lock( VLC_MOSAIC_MUTEX );
     if (p_es->p_picture == NULL)
+    {
         p_es->p_picture = p_new_pic;
+        p_es->tail      = p_new_pic;
+        p_new_pic->p_next = NULL;
+    }
     else
-        p_es->tail->p_next = p_new_pic;
-    p_new_pic->p_next = NULL;
-    p_es->tail = p_new_pic;
+        p_es->tail = vlc_picture_chain_Append( p_es->tail, p_new_pic );
     vlc_global_unlock( VLC_MOSAIC_MUTEX );
 }
 



More information about the vlc-commits mailing list