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
8f86c41d
Commit
8f86c41d
authored
Aug 15, 2006
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid an unnecessary encoding conversion when converting id3v1 tags. Also make getID3Info static.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@4642
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
c2e1ccd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
22 deletions
+17
-22
tag.c
src/tag.c
+17
-22
No files found.
src/tag.c
View file @
8f86c41d
...
@@ -133,7 +133,7 @@ void printMpdTag(int fd, MpdTag * tag)
...
@@ -133,7 +133,7 @@ void printMpdTag(int fd, MpdTag * tag)
}
}
#ifdef HAVE_ID3TAG
#ifdef HAVE_ID3TAG
MpdTag
*
getID3Info
(
struct
id3_tag
*
tag
,
char
*
id
,
int
type
,
MpdTag
*
mpdTag
)
static
MpdTag
*
getID3Info
(
struct
id3_tag
*
tag
,
char
*
id
,
int
type
,
MpdTag
*
mpdTag
)
{
{
struct
id3_frame
const
*
frame
;
struct
id3_frame
const
*
frame
;
id3_ucs4_t
const
*
ucs4
;
id3_ucs4_t
const
*
ucs4
;
...
@@ -159,29 +159,24 @@ MpdTag *getID3Info(struct id3_tag *tag, char *id, int type, MpdTag * mpdTag)
...
@@ -159,29 +159,24 @@ MpdTag *getID3Info(struct id3_tag *tag, char *id, int type, MpdTag * mpdTag)
if
(
type
==
TAG_ITEM_GENRE
)
if
(
type
==
TAG_ITEM_GENRE
)
ucs4
=
id3_genre_name
(
ucs4
);
ucs4
=
id3_genre_name
(
ucs4
);
utf8
=
id3_ucs4_utf8duplicate
(
ucs4
);
if
(
isId3v1
(
tag
)
&&
if
(
!
utf8
)
(
encoding
=
getConfigParamValue
(
CONF_ID3V1_ENCODING
)))
{
continue
;
isostr
=
id3_ucs4_latin1duplicate
(
ucs4
);
if
(
mpd_unlikely
(
!
isostr
))
if
(
isId3v1
(
tag
))
{
continue
;
encoding
=
getConfigParamValue
(
CONF_ID3V1_ENCODING
);
setCharSetConversion
(
"UTF-8"
,
encoding
);
if
(
encoding
)
{
utf8
=
(
id3_utf8_t
*
)
convStrDup
(
isostr
);
setCharSetConversion
(
"ISO-8859-1"
,
"UTF-8"
);
if
(
!
utf8
)
{
isostr
=
convStrDup
((
char
*
)
utf8
);
DEBUG
(
"Unable to convert %s string to UTF-8: "
free
(
utf8
);
"'%s'
\n
"
,
encoding
,
isostr
);
if
(
mpd_unlikely
(
!
isostr
))
continue
;
setCharSetConversion
(
"UTF-8"
,
encoding
);
utf8
=
(
id3_utf8_t
*
)
convStrDup
(
isostr
);
if
(
!
utf8
)
{
DEBUG
(
"Unable to convert %s string to "
"UTF-8: '%s'
\n
"
,
encoding
,
isostr
);
free
(
isostr
);
continue
;
}
free
(
isostr
);
free
(
isostr
);
continue
;
}
}
free
(
isostr
);
}
else
{
utf8
=
id3_ucs4_utf8duplicate
(
ucs4
);
if
(
mpd_unlikely
(
!
utf8
))
continue
;
}
}
if
(
mpdTag
==
NULL
)
if
(
mpdTag
==
NULL
)
...
...
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