[vlc-commits] decoder: reset the owner p_vout after it's released
Steve Lhomme
git at videolan.org
Thu Sep 19 15:03:39 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 19 09:24:13 2019 +0200| [df9c215acaea82c013973d3fa5601e3081a152d8] | committer: Steve Lhomme
decoder: reset the owner p_vout after it's released
It's cleaner to understand than ensuring every return before a new value is set
sets it back to NULL.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df9c215acaea82c013973d3fa5601e3081a152d8
---
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 800c01a37d..03286f887c 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -659,6 +659,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;
@@ -670,7 +671,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;
More information about the vlc-commits
mailing list