[vlc-devel] [PATCH] input: fix crash when flushing the decoder

Jean-Baptiste Kempf jb at videolan.org
Mon Aug 11 21:28:21 CEST 2014


I think this is the biggest crash reports we have on Android, now.

best,

Le 11/08/2014 02:56, Felix Abecassis a écrit :
> The crash can occur in the following situation:
> 1) A video decoder is created and starts waiting for the first picture:
>     b_waiting = true, b_first = true
>
> 2) The first picture is received but the decoder is still in waiting mode:
>     b_waiting = true, b_first = false
>
> 3) A second picture is received, the decoder is now waiting in
> DecoderWaitUnblock().
>
> 4) From the input thread, an EOF event is received, EsOutChangePosition is
> called and sets the decoder in flushing mode.
>
> 5) The decoder thread wakes up and exits DecoderWaitUnblock because
> b_flushing is true. However this triggers the assertion in
> DecoderDecodeVideo since we have b_waiting && !b_first.
> ---
>   src/input/decoder.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 87c65ef..7b8f585 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1326,7 +1326,7 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
>
>       bool b_reject = DecoderWaitUnblock( p_dec );
>
> -    if( p_owner->b_waiting )
> +    if( !b_reject && p_owner->b_waiting )
>       {
>           assert( p_owner->b_first );
>           msg_Dbg( p_dec, "Received first picture" );
>


-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list