Commit 0fde3bea authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

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.
parent d3d6c79c
......@@ -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 );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment