[vlc-devel] [PATCH 01/11] picture_chain: add vlc_picture_chain_PeekFront

Steve Lhomme robux4 at ycbcr.xyz
Thu Sep 24 16:49:09 CEST 2020


In some rare case we may want to check the picture at the top of the chain/FIFO
without popping it.
---
 include/vlc_picture.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index dc9e12e81c3..af57f335ed7 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -190,6 +190,18 @@ static inline picture_t * vlc_picture_chain_PopFront(picture_t **chain)
     return front;
 }
 
+/**
+ * Peek the front of a picture chain.
+ *
+ * The picture chain is unchanged.
+ *
+ * \return the front of the picture chain (the picture itself)
+ */
+static inline picture_t * vlc_picture_chain_PeekFront(picture_t **chain)
+{
+    return *chain;
+}
+
 /**
  * Append a picture to a picture chain.
  *
-- 
2.26.2



More information about the vlc-devel mailing list