[vlc-devel] [PATCH 1/3] decoder: process the last block when closing

Rémi Denis-Courmont remi at remlab.net
Tue Aug 2 08:35:06 CEST 2011


On Mon,  1 Aug 2011 23:17:36 -0400, Rafaël Carré <rafael.carre at gmail.com>
wrote:
> There might be a buffer still stored in packetizer buffers
> refs: #3178
> ---
>  src/input/decoder.c        |   10 +++++++++-
>  src/input/decoder.h        |    1 +
>  src/input/es_out.c         |   14 ++++++++++++++
>  src/input/input.c          |    1 +
>  src/input/input_internal.h |    2 ++
>  5 files changed, 27 insertions(+), 1 deletions(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 992ec9f..9f80efe 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -922,13 +922,21 @@ static void *DecoderThread( void *p_data )
>      /* The decoder's main loop */
>      for( ;; )
>      {
> +        bool eos = false;
>          block_t *p_block = block_FifoGet( p_owner->p_fifo );
>  
>          /* Make sure there is no cancellation point other than this
one^^.
>           * If you need one, be sure to push cleanup of p_block. */
>          DecoderSignalBuffering( p_dec, p_block == NULL );
>  
> -        if( p_block )
> +        if( p_block && p_block->i_flags & BLOCK_FLAG_EOS )
> +        {
> +            eos = true;
> +            block_Release( p_block );
> +            p_block = NULL;
> +        }

It might be better to not assume that the EOS block is empty? It could be
useful later.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list