[vlc-devel] Decoders & Invalid timestamp conversion problem

Francois Cartegnie fcvlcdev at free.fr
Tue Mar 18 04:36:16 CET 2014


Hi,

I'm investigating the MP4 "Invalid timestamp conversion" errors
happening with some formats (3GP) on seek.

This problem happens with huge blocks where Demuxer returns 1 block or
containing N packets for a total of 20 seconds. (See #7150 for sample)

On seek, INPUT_SET_POSITION resets clock to -1, while the decoder thread
is still in its DecoderDecodeAudio() loop, processing the block.

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

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 )
        {
            /* It prevent freezing VLC in case of broken decoder */
            block_Release( p_aout_buf );
            if( p_block )
                block_Release( p_block );
            break;
        }
        i_decoded++;

        if( p_owner->i_preroll_end > VLC_TS_INVALID &&
            p_aout_buf->i_pts < p_owner->i_preroll_end )
        {
            block_Release( p_aout_buf );
            continue;
        }

        if( p_owner->i_preroll_end > VLC_TS_INVALID )
        {
            msg_Dbg( p_dec, "End of audio preroll" );
            if( p_owner->p_aout )
                aout_DecFlush( p_owner->p_aout );
            /* */
            p_owner->i_preroll_end = VLC_TS_INVALID;
        }

        DecoderPlayAudio( p_dec, p_aout_buf, &i_played, &i_lost );
    }


Francois



More information about the vlc-devel mailing list