Commit a5120fbe authored by ivoire's avatar ivoire

lua_libs: lock the mutex when reading the stats of an item.

parent 240be494
......@@ -167,6 +167,7 @@ static int vlclua_input_stats( lua_State *L )
lua_newtable( L );
if( p_item )
{
vlc_mutex_lock( &p_item->p_stats->lock );
#define STATS_INT( n ) lua_pushinteger( L, p_item->p_stats->i_ ## n ); \
lua_setfield( L, -2, #n );
#define STATS_FLOAT( n ) lua_pushnumber( L, p_item->p_stats->f_ ## n ); \
......@@ -186,6 +187,7 @@ static int vlclua_input_stats( lua_State *L )
STATS_FLOAT( send_bitrate )
#undef STATS_INT
#undef STATS_FLOAT
vlc_mutex_unlock( &p_item->p_stats->lock );
}
if( p_input )
vlc_object_release( p_input );
......
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