[vlc-devel] [PATCH] block: zero counters on block_FifoEmpty()
Steve Lhomme
robux4 at ycbcr.xyz
Thu Jun 4 08:14:25 CEST 2020
LGTM
On 2020-06-03 18:31, RĂ©mi Denis-Courmont wrote:
> Call vlc_fifo_DequeueAllUnlocked() so that the block and byte counters
> are correctly reset to zero.
>
> Refs #24811.
> ---
> 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);
> }
>
> /**
> --
> 2.27.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list