Commit 08addc5a authored by Christophe Mutricy's avatar Christophe Mutricy

Fix a bunch of segfaults. It may be heavy handed and breaking other stuffs. zorglub to review

parent 28422e78
...@@ -699,8 +699,10 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick ) ...@@ -699,8 +699,10 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
p_input->counters.p_sout_send_bitrate = NULL; p_input->counters.p_sout_send_bitrate = NULL;
p_input->counters.p_sout_sent_packets = NULL; p_input->counters.p_sout_sent_packets = NULL;
p_input->counters.p_sout_sent_bytes = NULL; p_input->counters.p_sout_sent_bytes = NULL;
p_input->counters.p_demux_bitrate->update_interval = 1000000; if( p_input->counters.p_demux_bitrate )
p_input->counters.p_input_bitrate->update_interval = 1000000; p_input->counters.p_demux_bitrate->update_interval = 1000000;
if( p_input->counters.p_input_bitrate )
p_input->counters.p_input_bitrate->update_interval = 1000000;
vlc_mutex_init( p_input, &p_input->counters.counters_lock ); vlc_mutex_init( p_input, &p_input->counters.counters_lock );
/* handle sout */ /* handle sout */
...@@ -718,7 +720,8 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick ) ...@@ -718,7 +720,8 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
INIT_COUNTER( sout_sent_packets, INTEGER, COUNTER ); INIT_COUNTER( sout_sent_packets, INTEGER, COUNTER );
INIT_COUNTER (sout_sent_bytes, INTEGER, COUNTER ); INIT_COUNTER (sout_sent_bytes, INTEGER, COUNTER );
INIT_COUNTER( sout_send_bitrate, FLOAT, DERIVATIVE ); INIT_COUNTER( sout_send_bitrate, FLOAT, DERIVATIVE );
p_input->counters.p_sout_send_bitrate->update_interval = 1000000; if( p_input->counters.p_sout_send_bitrate )
p_input->counters.p_sout_send_bitrate->update_interval = 1000000;
} }
free( psz ); free( psz );
} }
......
...@@ -380,14 +380,17 @@ void __stats_TimersClean( vlc_object_t *p_obj ) ...@@ -380,14 +380,17 @@ void __stats_TimersClean( vlc_object_t *p_obj )
void stats_CounterClean( counter_t *p_c ) void stats_CounterClean( counter_t *p_c )
{ {
int i; int i;
for( i = p_c->i_samples - 1 ; i >= 0 ; i-- ) if( p_c )
{ {
counter_sample_t *p_s = p_c->pp_samples[i]; for( i = p_c->i_samples - 1 ; i >= 0 ; i-- )
REMOVE_ELEM( p_c->pp_samples, p_c->i_samples, i ); {
free( p_s ); counter_sample_t *p_s = p_c->pp_samples[i];
} REMOVE_ELEM( p_c->pp_samples, p_c->i_samples, i );
free( p_s );
}
if( p_c->psz_name ) free( p_c->psz_name ); if( p_c->psz_name ) free( p_c->psz_name );
free( p_c ); free( p_c );
}
} }
......
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