[vlc-commits] block: zero counters on block_FifoEmpty()

Rémi Denis-Courmont git at videolan.org
Sat Jun 6 08:07:52 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun  3 19:30:02 2020 +0300| [05ec2a1c591b71917cc8a944ce807ba693d5d4cb] | committer: Rémi Denis-Courmont

block: zero counters on block_FifoEmpty()

Call vlc_fifo_DequeueAllUnlocked() so that the block and byte counters
are correctly reset to zero.

Refs #24811.

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

 include/vlc_block.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/vlc_block.h b/include/vlc_block.h
index b57b4698cb..1acf4aa925 100644
--- a/include/vlc_block.h
+++ b/include/vlc_block.h
@@ -642,7 +642,12 @@ static inline void vlc_fifo_Cleanup(void *fifo)
  */
 static inline void block_FifoEmpty(block_fifo_t *fifo)
 {
-    block_ChainRelease((block_t *)vlc_queue_DequeueAll(vlc_fifo_queue(fifo)));
+    block_t *block;
+
+    vlc_fifo_Lock(fifo);
+    block = vlc_fifo_DequeueAllUnlocked(fifo);
+    vlc_fifo_Unlock(fifo);
+    block_ChainRelease(block);
 }
 
 /**



More information about the vlc-commits mailing list