[vlc-devel] [PATCH] codec: avcodec: rework for readframe loop

Ilkka Ollakka ileoo at videolan.org
Thu Jun 22 14:47:27 CEST 2017


On Thu, Jun 22, 2017 at 02:24:15PM +0200, Francois Cartegnie wrote:

Hi,

> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
> index 5bf2b67..65e9ea7 100644

>  /*****************************************************************************
>   * DecodeBlock: Called to decode one or more frames
>   *****************************************************************************/
> -static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error )
> +static int DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error )

You return VLC_EGENERIC/VLC_SUCCESS but you don't check it at all?

>  static int DecodeVideo( decoder_t *p_dec, block_t *p_block )
>  {
>      block_t **pp_block = p_block ? &p_block : NULL;
> -    picture_t *p_pic;
> +
>      bool error = false;
> -    while( ( p_pic = DecodeBlock( p_dec, pp_block, &error ) ) != NULL )
> -        decoder_QueueVideo( p_dec, p_pic );
> +    DecodeBlock( p_dec, pp_block, &error );
> +
>      return error ? VLCDEC_ECRITICAL : VLCDEC_SUCCESS;

Should this also take into an account DecodeBlock return-value?

-- 
Ilkka Ollakka
Snakes.  Why did it have to be snakes?
		-- Indiana Jones, "Raiders of the Lost Ark"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170622/6ffab9d2/attachment.sig>


More information about the vlc-devel mailing list