[vlc-devel] [PATCH] decoder: set the owner p_vout after it's released

Steve Lhomme robux4 at ycbcr.xyz
Thu Sep 19 09:30:23 CEST 2019


It's cleaner to understand than ensuring every return before a new value is set
sets it back to NULL.
---
 src/input/decoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index f0dc7f2455e..2935e3d6ef7 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -664,6 +664,7 @@ static subpicture_t *ModuleThread_NewSpuBuffer( decoder_t *p_dec,
             vout_UnregisterSubpictureChannel(p_owner->p_vout,
                                              p_owner->i_spu_channel);
             vout_Release(p_owner->p_vout);
+            p_owner->p_vout = NULL; // the DecoderThread should not use the old vout anymore
         }
 
         enum vlc_vout_order channel_order;
@@ -675,7 +676,6 @@ static subpicture_t *ModuleThread_NewSpuBuffer( 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; // 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