[vlc-commits] decoder: don't flush if already flushed
Thomas Guillem
git at videolan.org
Wed Nov 11 18:54:12 CET 2015
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Nov 9 18:55:01 2015 +0100| [69c4ec6092f9e10a5c5a5299d607035ccaa798e4] | committer: 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 <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=69c4ec6092f9e10a5c5a5299d607035ccaa798e4
---
src/input/decoder.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 8da034a..cacf7f2 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -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;
More information about the vlc-commits
mailing list