counter_t * __stats_CounterCreate( vlc_object_t *p_this,
int i_type, int i_compute_type )
{
- counter_t *p_counter;
- if( !p_this->p_libvlc->b_stats ) return NULL;
-
- p_counter = (counter_t*) malloc( sizeof( counter_t ) ) ;
+ counter_t *p_counter = (counter_t*) malloc( sizeof( counter_t ) ) ;
p_counter->i_compute_type = i_compute_type;
p_counter->i_type = i_type;
int __stats_Update( vlc_object_t *p_this, counter_t *p_counter,
vlc_value_t val, vlc_value_t *val_new )
{
- if( !p_this->p_libvlc->b_stats ) return VLC_EGENERIC;
+ if( !p_this->p_libvlc->b_stats || !p_counter ) return VLC_EGENERIC;
return CounterUpdate( p_this, p_counter, val, val_new );
}
*/
int __stats_Get( vlc_object_t *p_this, counter_t *p_counter, vlc_value_t *val )
{
- if( !p_this->p_libvlc->b_stats ) return VLC_EGENERIC;
-
- if( p_counter->i_samples == 0 )
+ if( !p_this->p_libvlc->b_stats || !p_counter || p_counter->i_samples == 0 )
{
val->i_int = val->f_float = 0.0;
return VLC_EGENERIC;
/* Input */
stats_GetInteger( p_input, p_input->counters.p_read_packets,
&p_stats->i_read_packets );
- stats_GetInteger( p_input, p_input->counters.p_read_bytes,
+ stats_GetInteger( p_input, p_input->counters.p_read_bytes,
&p_stats->i_read_bytes );
stats_GetFloat( p_input, p_input->counters.p_input_bitrate,
&p_stats->f_input_bitrate );