Skip to content
Snippets Groups Projects
Commit b770c640 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf
Browse files

input: don't lock to write stats if there are none

parent da1c3a13
No related branches found
No related tags found
1 merge request!3326input: don't lock to write stats if there are none
Pipeline #317075 passed with stages
in 43 minutes and 56 seconds
......@@ -594,16 +594,17 @@ static void MainLoopStatistics( input_thread_t *p_input )
es_out_SetTimes( priv->p_es_out, f_position, i_time, priv->normal_time,
i_length );
struct input_stats_t new_stats;
if( priv->stats != NULL )
input_stats_Compute( priv->stats, &new_stats );
if (priv->stats != NULL)
{
struct input_stats_t new_stats;
input_stats_Compute(priv->stats, &new_stats);
vlc_mutex_lock( &priv->p_item->lock );
if( priv->stats != NULL )
vlc_mutex_lock(&priv->p_item->lock);
*priv->p_item->p_stats = new_stats;
vlc_mutex_unlock( &priv->p_item->lock );
vlc_mutex_unlock(&priv->p_item->lock);
input_SendEventStatistics( p_input, &new_stats );
input_SendEventStatistics(p_input, &new_stats);
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment