[vlc-devel] [V4 PATCH 1/2] dec: lock aout/vout when read from DecoderThread

Thomas Guillem thomas at gllm.fr
Thu Jul 5 12:02:07 CEST 2018


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

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 2c332a9d53..dfcbf2ce66 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1573,7 +1573,9 @@ static void *DecoderThread( void *p_data )
             paused = p_owner->paused;
             vlc_fifo_Unlock( p_owner->p_fifo );
 
+            vlc_mutex_lock( &p_owner->lock );
             OutputChangePause( p_dec, paused, date );
+            vlc_mutex_unlock( &p_owner->lock );
 
             vlc_restorecancel( canc );
             vlc_fifo_Lock( p_owner->p_fifo );
@@ -1587,7 +1589,9 @@ static void *DecoderThread( void *p_data )
             rate = p_owner->rate;
             vlc_fifo_Unlock( p_owner->p_fifo );
 
+            vlc_mutex_lock( &p_owner->lock );
             OutputChangeRate( p_dec, rate );
+            vlc_mutex_unlock( &p_owner->lock );
 
             vlc_restorecancel( canc );
             vlc_fifo_Lock( p_owner->p_fifo );
-- 
2.18.0



More information about the vlc-devel mailing list