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

Ilkka Ollakka ileoo at videolan.org
Thu Jun 22 15:23:52 CEST 2017


On Thu, Jun 22, 2017 at 03:16:50PM +0200, Francois Cartegnie wrote:
> Le 22/06/2017 à 14:47, Ilkka Ollakka a écrit :
> > On Thu, Jun 22, 2017 at 02:24:15PM +0200, Francois Cartegnie wrote:
> >> -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?

> Because we don't make difference between critical and temporary errors.

> >>  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?

> It wasn't and should not. Only a fatal error should stop feeding or
> draining.

Is there any use to have return value from DecodeBlock with this patch
then? Other than possible future use?

-- 
Ilkka Ollakka
Buck-passing usually turns out to be a boomerang.
-------------- 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/310b79fe/attachment.sig>


More information about the vlc-devel mailing list