Commit b9169a56 authored by Max Kellermann's avatar Max Kellermann

Stats: move the GTimer variable out of struct stats

parent 2ecd5fa2
...@@ -30,16 +30,17 @@ ...@@ -30,16 +30,17 @@
#include <glib.h> #include <glib.h>
static GTimer *uptime;
static struct stats stats; static struct stats stats;
void stats_global_init(void) void stats_global_init(void)
{ {
stats.timer = g_timer_new(); uptime = g_timer_new();
} }
void stats_global_finish(void) void stats_global_finish(void)
{ {
g_timer_destroy(stats.timer); g_timer_destroy(uptime);
} }
void stats_update(void) void stats_update(void)
...@@ -77,7 +78,7 @@ stats_print(Client &client) ...@@ -77,7 +78,7 @@ stats_print(Client &client)
stats.artist_count, stats.artist_count,
stats.album_count, stats.album_count,
stats.song_count, stats.song_count,
(long)g_timer_elapsed(stats.timer, NULL), (long)g_timer_elapsed(uptime, NULL),
(long)(client.player_control.GetTotalPlayTime() + 0.5), (long)(client.player_control.GetTotalPlayTime() + 0.5),
stats.song_duration); stats.song_duration);
......
...@@ -21,11 +21,8 @@ ...@@ -21,11 +21,8 @@
#define MPD_STATS_HXX #define MPD_STATS_HXX
class Client; class Client;
typedef struct _GTimer GTimer;
struct stats { struct stats {
GTimer *timer;
/** number of song files in the music directory */ /** number of song files in the music directory */
unsigned song_count; unsigned song_count;
......
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