Commit ebd136c4 authored by Clément Stenac's avatar Clément Stenac

Some old stats fixes

parent 9056d31f
......@@ -281,6 +281,7 @@ static inline int __stats_GetInteger( vlc_object_t *p_obj, counter_t *p_counter,
{
int i_ret;
vlc_value_t val; val.i_int = 0;
if( !p_counter ) return VLC_EGENERIC;
i_ret = __stats_Get( p_obj, p_counter, &val );
*value = val.i_int;
return i_ret;
......@@ -292,6 +293,7 @@ static inline int __stats_GetFloat( vlc_object_t *p_obj, counter_t *p_counter,
{
int i_ret;
vlc_value_t val; val.f_float = 0.0;
if( !p_counter ) return VLC_EGENERIC;
i_ret = __stats_Get( p_obj, p_counter, &val );
*value = val.f_float;
return i_ret;
......@@ -303,6 +305,7 @@ static inline int __stats_UpdateInteger( vlc_object_t *p_obj,counter_t *p_co,
int i_ret;
vlc_value_t val;
vlc_value_t new_val; new_val.i_int = 0;
if( !p_co ) return VLC_EGENERIC;
val.i_int = i;
i_ret = __stats_Update( p_obj, p_co, val, &new_val );
if( pi_new )
......@@ -316,6 +319,7 @@ static inline int __stats_UpdateFloat( vlc_object_t *p_obj, counter_t *p_co,
vlc_value_t val;
int i_ret;
vlc_value_t new_val;new_val.f_float = 0.0;
if( !p_co ) return VLC_EGENERIC;
val.f_float = f;
i_ret = __stats_Update( p_obj, p_co, val, &new_val );
if( pf_new )
......
......@@ -54,10 +54,7 @@ static void TimerDump( vlc_object_t *p_this, counter_t *p_counter, vlc_bool_t);
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;
......
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