[vlc-devel] [PATCH] input: Fix race condition on input item titles
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Fri Aug 25 15:42:59 CEST 2017
Fix #18727
---
src/input/input.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/input/input.c b/src/input/input.c
index ae5fe03f81..af416b4b54 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2269,7 +2269,10 @@ static void UpdateGenericFromDemux( input_thread_t *p_input )
static void UpdateTitleListfromDemux( input_thread_t *p_input )
{
- input_source_t *in = input_priv(p_input)->master;
+ input_thread_private_t *priv = input_priv(p_input);
+ input_source_t *in = priv->master;
+
+ vlc_mutex_lock( &priv->p_item->lock );
/* Delete the preexisting titles */
if( in->i_title > 0 )
@@ -2288,6 +2291,7 @@ static void UpdateTitleListfromDemux( input_thread_t *p_input )
else
in->b_title_demux = true;
+ vlc_mutex_unlock( &priv->p_item->lock );
InitTitle( p_input );
}
--
2.11.0
More information about the vlc-devel
mailing list