[vlc-commits] picture_chain: add vlc_picture_chain_PeekFront

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 24 15:25:42 2020 +0200| [ee748458550635480644674cdee6b87cf62098d3] | committer: Steve Lhomme

picture_chain: add vlc_picture_chain_PeekFront

In some rare case we may want to check the picture at the top of the chain/FIFO
without popping it.

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

 include/vlc_picture.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index dc9e12e81c..af57f335ed 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.
  *



More information about the vlc-commits mailing list