Commit 69c4ec60 authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont

decoder: don't flush if already flushed

This commit fixes the following assert in the DecoderThread function:
"assert( vlc_fifo_IsEmpty( p_owner->p_fifo) );"

Indeed, if input_DecoderFlush is called again (just after), p_owner->flushed
will be true and the input won't wait for the DecoderThread. As a consequence,
the input will send blocks while the DecoderThread is flushing, hence the
assert.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 8074c41d
......@@ -1873,6 +1873,14 @@ void input_DecoderFlush( decoder_t *p_dec )
decoder_owner_sys_t *p_owner = p_dec->p_owner;
vlc_fifo_Lock( p_owner->p_fifo );
/* Don't flush if already flushed */
if( p_owner->flushed )
{
vlc_fifo_Unlock( p_owner->p_fifo );
return;
}
/* Empty the fifo */
block_ChainRelease( vlc_fifo_DequeueAllUnlocked( p_owner->p_fifo ) );
p_owner->flushing = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment