[vlc-devel] [RFC PATCH 08/12] decoder: extend lock scope
Thomas Guillem
thomas at gllm.fr
Tue Jul 19 19:36:30 CEST 2016
This will be used for a next commit.
It was already locked most of the time since p_block is likely to be valid.
---
src/input/decoder.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 69e4fc5..9a3acc5 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1390,15 +1390,18 @@ static void DecoderProcess( decoder_t *p_dec, block_t *p_block )
if( p_dec->b_error )
goto error;
+ vlc_mutex_lock( &p_owner->lock );
if( p_block )
{
if( p_block->i_buffer <= 0 )
+ {
+ vlc_mutex_unlock( &p_owner->lock );
goto error;
+ }
- vlc_mutex_lock( &p_owner->lock );
DecoderUpdatePreroll( &p_owner->i_preroll_end, p_block );
- vlc_mutex_unlock( &p_owner->lock );
}
+ vlc_mutex_unlock( &p_owner->lock );
#ifdef ENABLE_SOUT
if( p_owner->p_sout != NULL )
--
2.8.1
More information about the vlc-devel
mailing list