aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-03 14:52:53 +0100
committerMax Kellermann <max@duempel.org>2009-01-03 14:52:53 +0100
commitd17f0f435b39b19bdc8048c10f7bad7d8dbcd8b2 (patch)
tree488793f918983d4e35791c783309de6f5e5c1552 /src
parent03524fb81c81cf41b10fe1e478cd6a029afe1f29 (diff)
downloadmpd-d17f0f435b39b19bdc8048c10f7bad7d8dbcd8b2.tar.gz
mpd-d17f0f435b39b19bdc8048c10f7bad7d8dbcd8b2.tar.xz
mpd-d17f0f435b39b19bdc8048c10f7bad7d8dbcd8b2.zip
timer: use GLib instead of utils.h
Diffstat (limited to '')
-rw-r--r--src/timer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/timer.c b/src/timer.c
index 46e1cdd86..3cb497a17 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -20,9 +20,12 @@
#include "utils.h"
#include "audio_format.h"
+#include <glib.h>
+
#include <assert.h>
#include <limits.h>
#include <sys/time.h>
+#include <stddef.h>
static uint64_t now(void)
{
@@ -35,9 +38,7 @@ static uint64_t now(void)
Timer *timer_new(const struct audio_format *af)
{
- Timer *timer;
-
- timer = xmalloc(sizeof(Timer));
+ Timer *timer = g_new(Timer, 1);
timer->time = 0;
timer->started = 0;
timer->rate = af->sample_rate * audio_format_frame_size(af);
@@ -47,7 +48,7 @@ Timer *timer_new(const struct audio_format *af)
void timer_free(Timer *timer)
{
- free(timer);
+ g_free(timer);
}
void timer_start(Timer *timer)