[vlc-devel] [RFC PATCH 1/6] decoder: don't finish while draining
Thomas Guillem
thomas at gllm.fr
Thu Mar 16 16:43:20 CET 2017
If the decoder is draining, more pictures or blocks can be outputted, so wait
the drain to finish before querying outputs.
---
src/input/decoder.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 8a223da3df..f868559c54 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1985,8 +1985,13 @@ bool input_DecoderIsEmpty( decoder_t * p_dec )
assert( !p_owner->b_waiting );
- if( block_FifoCount( p_dec->p_owner->p_fifo ) > 0 )
+ vlc_fifo_Lock( p_owner->p_fifo );
+ if( vlc_fifo_GetCount( p_dec->p_owner->p_fifo ) > 0 || p_owner->b_draining )
+ {
+ vlc_fifo_Unlock( p_owner->p_fifo );
return false;
+ }
+ vlc_fifo_Unlock( p_owner->p_fifo );
bool b_empty;
--
2.11.0
More information about the vlc-devel
mailing list