Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
30f75f7f
Commit
30f75f7f
authored
Jan 03, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_id3: use GLib instead of utils.h
parent
c24a102c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
tag_id3.c
src/tag_id3.c
+12
-9
No files found.
src/tag_id3.c
View file @
30f75f7f
...
...
@@ -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
=
x
malloc
(
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment