static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
- input_thread_t *p_input = p_owner->p_input;
aout_buffer_t *p_aout_buf;
int i_decoded = 0;
int i_lost = 0;
}
/* Update ugly stat */
- if( i_decoded > 0 || i_lost > 0 || i_played > 0 )
+ input_thread_t *p_input = p_owner->p_input;
+
+ if( p_input != NULL && (i_decoded > 0 || i_lost > 0 || i_played > 0) )
{
vlc_mutex_lock( &p_input->p->counters.counters_lock);
static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
- input_thread_t *p_input = p_owner->p_input;
picture_t *p_pic;
int i_lost = 0;
int i_decoded = 0;
DecoderPlayVideo( p_dec, p_pic, &i_displayed, &i_lost );
}
- if( i_decoded > 0 || i_lost > 0 || i_displayed > 0 )
+
+ /* Update ugly stat */
+ input_thread_t *p_input = p_owner->p_input;
+
+ if( p_input != NULL && (i_decoded > 0 || i_lost > 0 || i_displayed > 0) )
{
vlc_mutex_lock( &p_input->p->counters.counters_lock );
while( (p_spu = p_dec->pf_decode_sub( p_dec, p_block ? &p_block : NULL ) ) )
{
- vlc_mutex_lock( &p_input->p->counters.counters_lock );
- stats_UpdateInteger( p_dec, p_input->p->counters.p_decoded_sub, 1, NULL );
- vlc_mutex_unlock( &p_input->p->counters.counters_lock );
+ if( p_input != NULL )
+ {
+ vlc_mutex_lock( &p_input->p->counters.counters_lock );
+ stats_UpdateInteger( p_dec, p_input->p->counters.p_decoded_sub, 1,
+ NULL );
+ vlc_mutex_unlock( &p_input->p->counters.counters_lock );
+ }
p_vout = input_resource_HoldVout( p_owner->p_resource );
if( p_vout && p_owner->p_spu_vout == p_vout )