[vlc-devel] [vlc-commits] codec: spudec: refactor spu fixes/validation

Steve Lhomme robux4 at ycbcr.xyz
Mon Jan 6 08:08:29 CET 2020


On 2020-01-04 21:02, Francois Cartegnie wrote:
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan  3 10:19:34 2020 +0100| [980f1309baf22ab3ba5a9b046d33d46fab67c7f6] | committer: Francois Cartegnie
> 
> codec: spudec: refactor spu fixes/validation
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=980f1309baf22ab3ba5a9b046d33d46fab67c7f6
> ---
> 
>   modules/codec/spudec/parse.c | 106 ++++++++++++++++++++++++-------------------
>   1 file changed, 59 insertions(+), 47 deletions(-)
> 
> diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c
> index b55c21ef7f..9616337a6c 100644
> --- a/modules/codec/spudec/parse.c
> +++ b/modules/codec/spudec/parse.c
> @@ -128,6 +128,13 @@ static void OutputPicture( decoder_t *p_dec,
>       p_spu->b_ephemer = p_spu_properties->b_ephemer;
>       p_spu->b_subtitle = p_spu_properties->b_subtitle;
>   
> +    if( p_spu->i_stop <= p_spu->i_start && !p_spu->b_ephemer )
> +    {
> +        /* This subtitle will live for 5 seconds or until the next subtitle */
> +        p_spu->i_stop = p_spu->i_start + VLC_TICK_FROM_MS(500 * 11);

What is the 11 for ? If you want 5s you should use VLC_TICK_FROM_SEC(5).

> +        p_spu->b_ephemer = true;
> +    }
> +
>       /* we are going to expand the RLE stuff so that we won't need to read
>        * nibbles later on. This will speed things up a lot. Plus, we'll only
>        * need to do this stupid interlacing stuff once.
> @@ -160,6 +167,55 @@ static void OutputPicture( decoder_t *p_dec,
>       pf_queue( p_dec, p_spu );
>   }
>   

> -    if( spu_properties.i_stop <= spu_properties.i_start && !spu_properties.b_ephemer )
> -    {
> -        /* This subtitle will live for 5 seconds or until the next subtitle */
> -        spu_properties.i_stop = spu_properties.i_start + VLC_TICK_FROM_MS(500 * 11);

Ditto

> -        spu_properties.b_ephemer = true;
> -    }
> -
> -    /* Get rid of padding bytes */
> -    if( p_sys->i_spu_size > i_index + 1 )
> -    {
> -        /* Zero or one padding byte are quite usual
> -         * More than one padding byte - this is very strange, but
> -         * we can ignore them. */
> -        msg_Warn( p_dec, "%i padding bytes, we usually get 0 or 1 of them",
> -                  p_sys->i_spu_size - i_index );
> -    }
> -


More information about the vlc-devel mailing list