song: use GLib instead of utils.h/log.h
This commit is contained in:
parent
2d6f469091
commit
3978b7b1ea
10
src/song.c
10
src/song.c
@ -19,14 +19,14 @@
|
|||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "ls.h"
|
#include "ls.h"
|
||||||
#include "directory.h"
|
#include "directory.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "mapper.h"
|
#include "mapper.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "playlist.h"
|
#include "playlist.h"
|
||||||
#include "decoder_list.h"
|
#include "decoder_list.h"
|
||||||
#include "decoder_api.h"
|
#include "decoder_api.h"
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -41,7 +41,7 @@ song_alloc(const char *url, struct directory *parent)
|
|||||||
assert(url);
|
assert(url);
|
||||||
urllen = strlen(url);
|
urllen = strlen(url);
|
||||||
assert(urllen);
|
assert(urllen);
|
||||||
song = xmalloc(sizeof(*song) - sizeof(song->url) + urllen + 1);
|
song = g_malloc(sizeof(*song) - sizeof(song->url) + urllen + 1);
|
||||||
|
|
||||||
song->tag = NULL;
|
song->tag = NULL;
|
||||||
memcpy(song->url, url, urllen + 1);
|
memcpy(song->url, url, urllen + 1);
|
||||||
@ -73,7 +73,7 @@ song_file_load(const char *path, struct directory *parent)
|
|||||||
assert((parent == NULL) == (*path == '/'));
|
assert((parent == NULL) == (*path == '/'));
|
||||||
|
|
||||||
if (strchr(path, '\n')) {
|
if (strchr(path, '\n')) {
|
||||||
DEBUG("newSong: '%s' is not a valid uri\n", path);
|
g_debug("newSong: '%s' is not a valid uri\n", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ song_free(struct song *song)
|
|||||||
{
|
{
|
||||||
if (song->tag)
|
if (song->tag)
|
||||||
tag_free(song->tag);
|
tag_free(song->tag);
|
||||||
free(song);
|
g_free(song);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Loading…
Reference in New Issue
Block a user