[vlc-devel] [PATCH 2/2] vlc_block: store per block ancillary

Rémi Denis-Courmont remi at remlab.net
Tue Jun 19 19:22:37 CEST 2018


Le tiistaina 19. kesäkuuta 2018, 19.50.36 EEST Francois Cartegnie a écrit :
> ---
>  include/vlc_block.h | 2 ++
>  src/misc/block.c    | 5 +++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/include/vlc_block.h b/include/vlc_block.h
> index 1c94783016..2e5f90da55 100644
> --- a/include/vlc_block.h
> +++ b/include/vlc_block.h
> @@ -127,6 +127,8 @@ struct block_t
> 
>      /* Rudimentary support for overloading block (de)allocation. */
>      block_free_t pf_release;
> +
> +    vlc_ancillary_t *p_anc;
>  };
> 
>  VLC_API void block_Init( block_t *, void *, size_t );
> diff --git a/src/misc/block.c b/src/misc/block.c
> index 12299f36ab..5858714d52 100644
> --- a/src/misc/block.c
> +++ b/src/misc/block.c
> @@ -34,6 +34,7 @@
>  #include <vlc_common.h>
>  #include <vlc_block.h>
>  #include <vlc_fs.h>
> +#include <vlc_ancillary.h>
> 
>  #ifndef NDEBUG
>  static void BlockNoRelease( block_t *b )
> @@ -67,6 +68,7 @@ static void block_Invalidate (block_t *block)
>      block->p_next = NULL;
>      block_Check (block);
>      block->pf_release = BlockNoRelease;
> +    vlc_ancillary_StorageEmpty(&block->p_anc);
>  }
>  #else
>  # define block_Check(b) ((void)(b))
> @@ -86,6 +88,7 @@ void block_Init( block_t *restrict b, void *buf, size_t
> size ) b->i_pts =
>      b->i_dts = VLC_TS_INVALID;
>      b->i_length = 0;
> +    b->p_anc = NULL;
>  #ifndef NDEBUG
>      b->pf_release = BlockNoRelease;
>  #endif
> @@ -107,6 +110,8 @@ static void BlockMetaCopy( block_t *restrict out, const
> block_t *in ) out->i_pts     = in->i_pts;
>      out->i_flags   = in->i_flags;
>      out->i_length  = in->i_length;
> +    if( in->p_anc )
> +        vlc_ancillary_StorageMerge( &out->p_anc, in->p_anc );
>  }
> 
>  /** Initial memory alignment of data block.

This is out of place. Block_t is a generic data structure, not some demux/
codec internal.

-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list