[vlc-devel] [PATCH 1/4] fifo: cleanup
Thomas Guillem
thomas at gllm.fr
Mon Apr 13 13:22:05 CEST 2020
Hello,
This set was pushed without giving me the chance to review it.
I think that we should wait more for patches proposed during the week-end. I think that we already decided that for the future gitlab rules.
On Sat, Apr 11, 2020, at 20:41, RĂ©mi Denis-Courmont wrote:
> Reuse own block_fifo_t functions.
> ---
> src/misc/fifo.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/src/misc/fifo.c b/src/misc/fifo.c
> index f6878d8eb8..564c83f64f 100644
> --- a/src/misc/fifo.c
> +++ b/src/misc/fifo.c
> @@ -155,7 +155,7 @@ block_fifo_t *block_FifoNew( void )
>
> void block_FifoRelease( block_fifo_t *p_fifo )
> {
> - block_ChainRelease( p_fifo->p_first );
> + block_FifoEmpty(p_fifo);
> free( p_fifo );
> }
>
> @@ -199,10 +199,10 @@ block_t *block_FifoShow( block_fifo_t *p_fifo )
> {
> block_t *b;
>
> - vlc_mutex_lock( &p_fifo->lock );
> + vlc_fifo_Lock(p_fifo);
> assert(p_fifo->p_first != NULL);
> b = p_fifo->p_first;
> - vlc_mutex_unlock( &p_fifo->lock );
> + vlc_fifo_Unlock(p_fifo);
>
> return b;
> }
> @@ -212,9 +212,9 @@ size_t block_FifoSize (block_fifo_t *fifo)
> {
> size_t size;
>
> - vlc_mutex_lock (&fifo->lock);
> - size = fifo->i_size;
> - vlc_mutex_unlock (&fifo->lock);
> + vlc_fifo_Lock(fifo);
> + size = vlc_fifo_GetBytes(fifo);
> + vlc_fifo_Unlock(fifo);
> return size;
> }
>
> @@ -223,8 +223,8 @@ size_t block_FifoCount (block_fifo_t *fifo)
> {
> size_t depth;
>
> - vlc_mutex_lock (&fifo->lock);
> - depth = fifo->i_depth;
> - vlc_mutex_unlock (&fifo->lock);
> + vlc_fifo_Lock(fifo);
> + depth = vlc_fifo_GetCount(fifo);
> + vlc_fifo_Unlock(fifo);
> return depth;
> }
> --
> 2.26.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