From 0fde3beaa85528e555bac9c1b327ba5a32da67e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 17 Mar 2015 20:45:51 +0200 Subject: [PATCH] decoder: fix data race in input_DecoderIsEmpty() p_dec->fmt_out is owned by the decoder plugin, and can only safely be accessed by the core from within decoder callbacks, notably the format update callbacks. Outside that context, p_owner->fmt has to be used. It contains a copy of p_dec->fmt_out at the last format update. --- src/input/decoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input/decoder.c b/src/input/decoder.c index 3ccad9b5ba..ad5428824c 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -382,9 +382,9 @@ bool input_DecoderIsEmpty( decoder_t * p_dec ) { vlc_mutex_lock( &p_owner->lock ); /* TODO subtitles support */ - if( p_dec->fmt_out.i_cat == VIDEO_ES && p_owner->p_vout ) + if( p_owner->fmt.i_cat == VIDEO_ES && p_owner->p_vout ) b_empty = vout_IsEmpty( p_owner->p_vout ); - else if( p_dec->fmt_out.i_cat == AUDIO_ES && p_owner->p_aout ) + else if( p_owner->fmt.i_cat == AUDIO_ES && p_owner->p_aout ) b_empty = aout_DecIsEmpty( p_owner->p_aout ); vlc_mutex_unlock( &p_owner->lock ); } -- 2.39.2