[vlc-commits] picture_chain: pass a vlc_picture_chain_t to vlc_picture_chain_Pop/PeekFront

Steve Lhomme git at videolan.org
Tue Oct 6 13:27:23 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 24 13:53:39 2020 +0200| [745b8d13f626e52a4ea4cf37631216fbffab455b] | committer: Steve Lhomme

picture_chain: pass a vlc_picture_chain_t to vlc_picture_chain_Pop/PeekFront

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

 include/vlc_picture.h              | 10 +++++-----
 modules/hw/mmal/converter.c        |  2 +-
 modules/spu/mosaic.c               |  8 ++++----
 modules/stream_out/mosaic_bridge.c |  2 +-
 src/misc/filter_chain.c            |  2 +-
 src/misc/picture_fifo.c            |  4 ++--
 src/video_output/snapshot.c        |  4 ++--
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index 136957da5e..03d7e49266 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -204,12 +204,12 @@ static inline bool vlc_picture_chain_IsEmpty(const vlc_picture_chain_t *chain)
  *
  * \return the front of the picture chain (the picture itself)
  */
-static inline picture_t * vlc_picture_chain_PopFront(picture_t **chain)
+static inline picture_t * vlc_picture_chain_PopFront(vlc_picture_chain_t *chain)
 {
-    picture_t *front = *chain;
+    picture_t *front = chain->front;
     if (front)
     {
-        *chain = front->p_next;
+        chain->front = front->p_next;
         // unlink the front picture from the rest of the chain
         front->p_next = NULL;
     }
@@ -223,9 +223,9 @@ static inline picture_t * vlc_picture_chain_PopFront(picture_t **chain)
  *
  * \return the front of the picture chain (the picture itself)
  */
-static inline picture_t * vlc_picture_chain_PeekFront(picture_t **chain)
+static inline picture_t * vlc_picture_chain_PeekFront(vlc_picture_chain_t *chain)
 {
-    return *chain;
+    return chain->front;
 }
 
 /**
diff --git a/modules/hw/mmal/converter.c b/modules/hw/mmal/converter.c
index 8f5b650097..8b86c68686 100644
--- a/modules/hw/mmal/converter.c
+++ b/modules/hw/mmal/converter.c
@@ -118,7 +118,7 @@ static MMAL_FOURCC_T pic_to_slice_mmal_fourcc(MMAL_FOURCC_T fcc)
 
 static picture_t * pic_fifo_get(vlc_picture_chain_t * const pf)
 {
-    return vlc_picture_chain_PopFront( &pf->front );
+    return vlc_picture_chain_PopFront( &pf );
 }
 
 static void pic_fifo_release_all(vlc_picture_chain_t * const pf)
diff --git a/modules/spu/mosaic.c b/modules/spu/mosaic.c
index c1c1965305..bf1c6c800c 100644
--- a/modules/spu/mosaic.c
+++ b/modules/spu/mosaic.c
@@ -531,14 +531,14 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
 
         while ( !vlc_picture_chain_IsEmpty( &p_es->pictures ) )
         {
-            picture_t *front = vlc_picture_chain_PeekFront( &p_es->pictures.front );
+            picture_t *front = vlc_picture_chain_PeekFront( &p_es->pictures );
             if ( front->date + p_sys->i_delay >= date )
                 break; // front picture not late
 
             if ( picture_HasChainedPics( front ) )
             {
                 // front picture is late and has more pictures chained, skip it
-                front = vlc_picture_chain_PopFront( &p_es->pictures.front );
+                front = vlc_picture_chain_PopFront( &p_es->pictures );
                 picture_Release( front );
                 continue;
             }
@@ -546,7 +546,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
             if ( front->date + p_sys->i_delay + BLANK_DELAY < date )
             {
                 // front picture is late and too old, don't display it
-                front = vlc_picture_chain_PopFront( &p_es->pictures.front );
+                front = vlc_picture_chain_PopFront( &p_es->pictures );
                 // the picture chain is empty as the front didn't have chained pics
                 picture_Release( front );
                 break;
@@ -589,7 +589,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
         video_format_Init( &fmt_in, 0 );
         video_format_Init( &fmt_out, 0 );
 
-        p_converted = vlc_picture_chain_PeekFront( &p_es->pictures.front );
+        p_converted = vlc_picture_chain_PeekFront( &p_es->pictures );
         if ( !p_sys->b_keep )
         {
             /* Convert the images */
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index f298c41764..e39fa95541 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -464,7 +464,7 @@ static void Del( sout_stream_t *p_stream, void *id )
     p_es->b_empty = true;
     while ( !vlc_picture_chain_IsEmpty( &p_es->pictures ) )
     {
-        picture_t *es_picture = vlc_picture_chain_PopFront( &p_es->pictures.front );
+        picture_t *es_picture = vlc_picture_chain_PopFront( &p_es->pictures );
         picture_Release( es_picture );
     }
 
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index ec0e40d41e..176135bc0d 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -532,7 +532,7 @@ static void FilterDeletePictures( vlc_picture_chain_t *pictures )
 {
     while( !vlc_picture_chain_IsEmpty( pictures ) )
     {
-        picture_t *next = vlc_picture_chain_PopFront( &pictures->front );
+        picture_t *next = vlc_picture_chain_PopFront( pictures );
         picture_Release( next );
     }
 }
diff --git a/src/misc/picture_fifo.c b/src/misc/picture_fifo.c
index cca4c64d05..32474fe2ef 100644
--- a/src/misc/picture_fifo.c
+++ b/src/misc/picture_fifo.c
@@ -52,7 +52,7 @@ static void PictureFifoPush(picture_fifo_t *fifo, picture_t *picture)
 }
 static picture_t *PictureFifoPop(picture_fifo_t *fifo)
 {
-    return vlc_picture_chain_PopFront( &fifo->pics.front );
+    return vlc_picture_chain_PopFront( &fifo->pics );
 }
 
 picture_fifo_t *picture_fifo_New(void)
@@ -101,7 +101,7 @@ void picture_fifo_Flush(picture_fifo_t *fifo, vlc_tick_t date, bool flush_before
     PictureFifoReset(&tmp);
 
     while ( !vlc_picture_chain_IsEmpty( &old_chain ) ) {
-        picture_t *picture = vlc_picture_chain_PopFront( &old_chain.front );
+        picture_t *picture = vlc_picture_chain_PopFront( &old_chain );
 
         if ((date == VLC_TICK_INVALID) ||
             ( flush_before && picture->date <= date) ||
diff --git a/src/video_output/snapshot.c b/src/video_output/snapshot.c
index e415f01602..a98380d343 100644
--- a/src/video_output/snapshot.c
+++ b/src/video_output/snapshot.c
@@ -70,7 +70,7 @@ void vout_snapshot_Destroy(vout_snapshot_t *snap)
         return;
 
     while ( !vlc_picture_chain_IsEmpty( &snap->pics ) ) {
-        picture_t *picture = vlc_picture_chain_PopFront( &snap->pics.front );
+        picture_t *picture = vlc_picture_chain_PopFront( &snap->pics );
         picture_Release(picture);
     }
 
@@ -108,7 +108,7 @@ picture_t *vout_snapshot_Get(vout_snapshot_t *snap, vlc_tick_t timeout)
         vlc_cond_timedwait(&snap->wait, &snap->lock, deadline) == 0);
 
     /* */
-    picture_t *picture = vlc_picture_chain_PopFront( &snap->pics.front );
+    picture_t *picture = vlc_picture_chain_PopFront( &snap->pics );
     if (!picture && snap->request_count > 0)
         snap->request_count--;
 



More information about the vlc-commits mailing list