[vlc-devel] Decoders & Invalid timestamp conversion problem

Rémi Denis-Courmont remi at remlab.net
Tue Mar 18 09:49:31 CET 2014

On Tue, 18 Mar 2014 04:36:16 +0100, Francois Cartegnie <fcvlcdev at free.fr>
> On seek, INPUT_SET_POSITION resets clock to -1, while the decoder thread
> is still in its DecoderDecodeAudio() loop, processing the block.

The input clock is only used up to the ES output. The decoder and the
audio output do not depend on the input clock. So that should not be a

> From this point, remaining packets are sent to DecoderPlayAudio which
> now uses an invalid reference clock and triggers the error.

What is that even supposed to mean? The reference clock for the audio
decoder and output is mdate(). How can it be "invalid"?

> The problem stops when using the p_owner->b_flushing condition to drop
> current block. I'm unsure if that's a correct fix.
>     while( (p_aout_buf = p_dec->pf_decode_audio( p_dec, &p_block )) )
>     {
> -        if( DecoderIsExitRequested( p_dec ) )
> +        if( DecoderIsExitRequested( p_dec ) || p_owner->b_flushing )

You cannot access b_flushing here anyway.

>         {
>             /* It prevent freezing VLC in case of broken decoder */
>             block_Release( p_aout_buf );
>             if( p_block )
>                 block_Release( p_block );

This will potentially discard the special flush audio block, leading to
the flush request never being acknowledged and the ES output getting stuck.
This hack only works in the specific situation of an exiting decoder (and
even then I don't think it is needed anymore).

Rémi Denis-Courmont
Sent from my collocated server

More information about the vlc-devel mailing list