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
5e2f98fd
Commit
5e2f98fd
authored
Jul 19, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_ape: moved code to tag_ape_import_item()
Improve code readability.
parent
7b927506
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
tag_ape.c
src/tag_ape.c
+22
-12
No files found.
src/tag_ape.c
View file @
5e2f98fd
...
...
@@ -44,6 +44,26 @@ static const int tagItems[7] = {
TAG_ITEM_DATE
,
};
static
struct
tag
*
tag_ape_import_item
(
struct
tag
*
tag
,
unsigned
long
flags
,
const
char
*
key
,
const
char
*
value
,
size_t
value_length
)
{
/* we only care about utf-8 text tags */
if
((
flags
&
(
0x3
<<
1
))
!=
0
)
return
tag
;
for
(
unsigned
i
=
0
;
i
<
7
;
i
++
)
{
if
(
g_ascii_strcasecmp
(
key
,
apeItems
[
i
])
==
0
)
{
if
(
tag
==
NULL
)
tag
=
tag_new
();
tag_add_item_n
(
tag
,
tagItems
[
i
],
value
,
value_length
);
}
}
return
tag
;
}
struct
tag
*
tag_ape_load
(
const
char
*
file
)
{
...
...
@@ -55,7 +75,6 @@ tag_ape_load(const char *file)
size_t
tagLen
;
size_t
size
;
unsigned
long
flags
;
int
i
;
char
*
key
;
struct
{
...
...
@@ -123,17 +142,8 @@ tag_ape_load(const char *file)
if
(
tagLen
<
size
)
goto
fail
;
/* we only care about utf-8 text tags */
if
(
!
(
flags
&
(
0x3
<<
1
)))
{
for
(
i
=
0
;
i
<
7
;
i
++
)
{
if
(
g_ascii_strcasecmp
(
key
,
apeItems
[
i
])
==
0
)
{
if
(
!
ret
)
ret
=
tag_new
();
tag_add_item_n
(
ret
,
tagItems
[
i
],
p
,
size
);
}
}
}
ret
=
tag_ape_import_item
(
ret
,
flags
,
key
,
p
,
size
);
p
+=
size
;
tagLen
-=
size
;
}
...
...
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