[vlc-commits] input: waiting and flushing states should be mutually exclusive
Felix Abecassis
git at videolan.org
Tue Sep 2 18:04:31 CEST 2014
vlc/vlc-2.2 | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Tue Sep 2 11:00:23 2014 +0200| [a801b6b7e27a299435d4adf64194f9c448fee920] | committer: Jean-Baptiste Kempf
input: waiting and flushing states should be mutually exclusive
A crash could 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.
Fix #11892, #12041
(cherry picked from commit a1603d9e69629a8168f5babce3388307bb677341)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=a801b6b7e27a299435d4adf64194f9c448fee920
---
src/input/decoder.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 87c65ef..289b5fd 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -937,6 +937,7 @@ static void DecoderFlush( decoder_t *p_dec )
/* Empty the fifo */
block_FifoEmpty( p_owner->p_fifo );
+ p_owner->b_waiting = false;
/* Monitor for flush end */
p_owner->b_flushing = true;
vlc_cond_signal( &p_owner->wait_request );
More information about the vlc-commits
mailing list