[vlc-devel] [RFC PATCH 3/6] decoder: abort decoding in case of error in packetize loop

Thomas Guillem thomas at gllm.fr
Fri Jul 1 18:14:52 CEST 2016


---
 src/input/decoder.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index f0a87e8..ea49175 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1027,6 +1027,11 @@ static void DecoderProcessVideo( decoder_t *p_dec, block_t *p_block )
                 p_packetized_block->p_next = NULL;
 
                 DecoderDecodeVideo( p_dec, p_packetized_block );
+                if( atomic_load( &p_dec->state ) & DECODER_STATE_ERROR )
+                {
+                    block_ChainRelease( p_next );
+                    return;
+                }
 
                 p_packetized_block = p_next;
             }
@@ -1202,6 +1207,11 @@ static void DecoderProcessAudio( decoder_t *p_dec, block_t *p_block )
                 p_packetized_block->p_next = NULL;
 
                 DecoderDecodeAudio( p_dec, p_packetized_block );
+                if( atomic_load( &p_dec->state ) & DECODER_STATE_ERROR )
+                {
+                    block_ChainRelease( p_next );
+                    return;
+                }
 
                 p_packetized_block = p_next;
             }
-- 
2.8.1



More information about the vlc-devel mailing list