aboutsummaryrefslogtreecommitdiff
path: root/src/tag_id3.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-03 14:51:41 +0100
committerMax Kellermann <max@duempel.org>2009-01-03 14:51:41 +0100
commit30f75f7f01a2241fa8554ee1627e358a2cc8a3d0 (patch)
treebd2d6957b55c8c3a0b028a57660eb788b5c7c23e /src/tag_id3.c
parentc24a102c989922cb11fb655b9d1e3d56bdc5200b (diff)
tag_id3: use GLib instead of utils.h
Diffstat (limited to 'src/tag_id3.c')
-rw-r--r--src/tag_id3.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/tag_id3.c b/src/tag_id3.c
index 63b20b8f..d060c658 100644
--- a/src/tag_id3.c
+++ b/src/tag_id3.c
@@ -18,12 +18,15 @@
#include "tag_id3.h"
#include "tag.h"
-#include "utils.h"
#include "conf.h"
#include <glib.h>
#include <id3tag.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "id3"
@@ -66,10 +69,10 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
g_debug("Unable to convert %s string to UTF-8: '%s'",
encoding, isostr);
g_error_free(error);
- free(isostr);
+ g_free(isostr);
return NULL;
}
- free(isostr);
+ g_free(isostr);
} else {
utf8 = id3_ucs4_utf8duplicate(ucs4);
if (G_UNLIKELY(!utf8)) {
@@ -78,7 +81,7 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
}
utf8_stripped = (id3_utf8_t *)g_strdup(g_strstrip((gchar *)utf8));
- free(utf8);
+ g_free(utf8);
return utf8_stripped;
}
@@ -147,7 +150,7 @@ static struct tag *getID3Info(
if (mpdTag == NULL)
mpdTag = tag_new();
tag_add_item(mpdTag, type, (char *)utf8);
- free(utf8);
+ g_free(utf8);
}
}
else {
@@ -180,7 +183,7 @@ static struct tag *getID3Info(
if (mpdTag == NULL)
mpdTag = tag_new();
tag_add_item(mpdTag, type, (char *)utf8);
- free(utf8);
+ g_free(utf8);
}
}
}
@@ -259,18 +262,18 @@ static struct id3_tag *getId3Tag(FILE * stream, long offset, int whence)
if (tagSize <= 0) return NULL;
/* Found a tag. Allocate a buffer and read it in. */
- tagBuf = xmalloc(tagSize);
+ tagBuf = g_malloc(tagSize);
if (!tagBuf) return NULL;
tagBufSize = fillBuffer(tagBuf, tagSize, stream, offset, whence);
if (tagBufSize < tagSize) {
- free(tagBuf);
+ g_free(tagBuf);
return NULL;
}
tag = id3_tag_parse(tagBuf, tagBufSize);
- free(tagBuf);
+ g_free(tagBuf);
return tag;
}