[vlc-devel] [PATCH] decoder: unblock broken decoders when seeking on pause

Rémi Denis-Courmont remi at remlab.net
Tue Oct 28 10:22:58 CET 2014


Le 2014-10-28 11:43, Thomas Guillem a écrit :
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 972522a..2bca404 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1229,6 +1229,13 @@ static void DecoderDecodeAudio( decoder_t
> *p_dec, block_t *p_block )
>          }
>
>          DecoderPlayAudio( p_dec, p_aout_buf, &i_played, &i_lost );
> +
> +        if( p_block && DecoderIsFlushing( p_dec ) )
> +        {
> +            /* It prevent freezing VLC in case of broken decoder */
> +            block_Release( p_block );
> +            break;
> +        }

Essentially, that is truncating the byte stream sent to the codec 
whenever flushing. For most codecs that won't have much consequences, 
but in general this is not acceptable since it can screw up the 
packetizer or decoder internal state. The problem is still the same: you 
cannot discard data blindly - unless the decoder is never used anyway.

Ditto for video.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list