[vlc-devel] [PATCH] decoder: document the temporarily reset of aout/vout under lock in the OutputThread

Steve Lhomme robux4 at ycbcr.xyz
Wed Sep 4 15:11:16 CEST 2019


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

diff --git a/src/input/decoder.c b/src/input/decoder.c
index df4f2644aef..cdc7194e96b 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -320,7 +320,7 @@ static int aout_update_format( decoder_t *p_dec )
 
         /* Parameters changed, restart the aout */
         vlc_mutex_lock( &p_owner->lock );
-        p_owner->p_aout = NULL;
+        p_owner->p_aout = NULL; // the DecoderThread should not use the old aout anymore
         vlc_mutex_unlock( &p_owner->lock );
         aout_DecDelete( p_aout );
 
@@ -535,7 +535,7 @@ static int vout_update_format( decoder_t *p_dec )
         vlc_mutex_lock( &p_owner->lock );
 
         p_vout = p_owner->p_vout;
-        p_owner->p_vout = NULL;
+        p_owner->p_vout = NULL; // the DecoderThread should not use the old vout anymore
         vlc_mutex_unlock( &p_owner->lock );
 
         unsigned dpb_size;
@@ -639,7 +639,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
             p_owner->i_spu_channel = VOUT_SPU_CHANNEL_INVALID;
 
             vout_Release(p_owner->p_vout);
-            p_owner->p_vout = NULL;
+            p_owner->p_vout = NULL; // the DecoderThread should not use the old vout anymore
             vlc_mutex_unlock( &p_owner->lock );
         }
         return NULL;
@@ -670,7 +670,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
         if (p_owner->i_spu_channel == VOUT_SPU_CHANNEL_INVALID)
         {
             /* The new vout doesn't support SPU, aborting... */
-            p_owner->p_vout = NULL;
+            p_owner->p_vout = NULL; // the DecoderThread should not use the old vout anymore
             vlc_mutex_unlock(&p_owner->lock);
             vout_Release(p_vout);
             return NULL;
-- 
2.17.1



More information about the vlc-devel mailing list