Commit aec5639a authored by Laurent Aimar's avatar Laurent Aimar

Allow to stop decoder even in infinite decoder loop (in case of broken decoder).

parent d34e1a85
......@@ -625,6 +625,13 @@ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
while( (p_aout_buf = p_dec->pf_decode_audio( p_dec, &p_block )) )
{
if( p_dec->b_die )
{
/* It prevent freezing VLC in case of broken decoder */
if( p_block )
block_Release( p_block );
break;
}
vlc_mutex_lock( &p_input->p->counters.counters_lock );
stats_UpdateInteger( p_dec, p_input->p->counters.p_decoded_audio, 1, NULL );
vlc_mutex_unlock( &p_input->p->counters.counters_lock );
......@@ -829,6 +836,14 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
while( (p_pic = p_dec->pf_decode_video( p_dec, &p_block )) )
{
if( p_dec->b_die )
{
/* It prevent freezing VLC in case of broken decoder */
if( p_block )
block_Release( p_block );
break;
}
vlc_mutex_lock( &p_input->p->counters.counters_lock );
stats_UpdateInteger( p_dec, p_input->p->counters.p_decoded_video, 1, NULL );
vlc_mutex_unlock( &p_input->p->counters.counters_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