[vlc-commits] picture_chain: make sure picture we add to a chain don't have chained pictures

Steve Lhomme git at videolan.org
Mon Oct 19 09:35:43 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Oct 15 10:58:30 2020 +0200| [fb786543cee407fa67adcfbdfc571013971cce52] | committer: Steve Lhomme

picture_chain: make sure picture we add to a chain don't have chained pictures

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

 include/vlc_picture.h | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index cf2b310ef8..e5be1be14a 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -167,6 +167,14 @@ static inline vlc_video_context* picture_GetVideoContext(picture_t *pic)
     return pic->context ? pic->context->vctx : NULL;
 }
 
+/**
+ * Check whether a picture has other pictures linked
+ */
+static inline bool picture_HasChainedPics(const picture_t *pic)
+{
+    return pic->p_next != NULL;
+}
+
 /**
  * picture chaining helpers
  */
@@ -244,6 +252,8 @@ static inline void vlc_picture_chain_Append(vlc_picture_chain_t *chain,
         chain->front = pic;
     else
         chain->tail->p_next = pic;
+    // make sure the picture doesn't have chained pics
+    vlc_assert( !picture_HasChainedPics( pic ) );
     pic->p_next = NULL; // we're appending a picture, not a chain
     chain->tail = pic;
 }
@@ -270,14 +280,6 @@ static inline void vlc_picture_chain_GetAndClear(vlc_picture_chain_t *in,
     vlc_picture_chain_Init(in);
 }
 
-/**
- * Check whether a picture has other pictures linked
- */
-static inline bool picture_HasChainedPics(const picture_t *pic)
-{
-    return pic->p_next != NULL;
-}
-
 /**
  * Reset a picture chain.
  *



More information about the vlc-commits mailing list