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
748a8a6f
Commit
748a8a6f
authored
Dec 07, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_id3: support multiple values
Loop over all frames with a specific id, and import all of them - not just the first one (index 0).
parent
cb9965ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
NEWS
NEWS
+1
-0
tag_id3.c
src/tag_id3.c
+34
-8
No files found.
NEWS
View file @
748a8a6f
...
...
@@ -20,6 +20,7 @@ ver 0.16 (20??/??/??)
* tags:
- added tags "ArtistSort", "AlbumArtistSort"
- id3: revised "performer" tag support
- id3: support multiple values
- ape: MusicBrainz tags
- ape: support multiple values
* decoders:
...
...
src/tag_id3.c
View file @
748a8a6f
...
...
@@ -126,17 +126,16 @@ import_id3_string(bool is_id3v1, const id3_ucs4_t *ucs4)
* - string list
*/
static
void
tag_id3_import_text
(
struct
tag
*
dest
,
struct
id3_tag
*
tag
,
const
char
*
id
,
tag_id3_import_text_frame
(
struct
tag
*
dest
,
struct
id3_tag
*
tag
,
const
struct
id3_frame
*
frame
,
enum
tag_type
type
)
{
struct
id3_frame
const
*
frame
;
id3_ucs4_t
const
*
ucs4
;
id3_utf8_t
*
utf8
;
union
id3_field
const
*
field
;
unsigned
int
nstrings
,
i
;
frame
=
id3_tag_findframe
(
tag
,
id
,
0
);
if
(
frame
==
NULL
||
frame
->
nfields
!=
2
)
if
(
frame
->
nfields
!=
2
)
return
;
/* check the encoding field */
...
...
@@ -171,6 +170,20 @@ tag_id3_import_text(struct tag *dest, struct id3_tag *tag, const char *id,
}
/**
* Import all text frames with the specified id (ID3v2.4.0 section
* 4.2). This is a wrapper for tag_id3_import_text_frame().
*/
static
void
tag_id3_import_text
(
struct
tag
*
dest
,
struct
id3_tag
*
tag
,
const
char
*
id
,
enum
tag_type
type
)
{
const
struct
id3_frame
*
frame
;
for
(
unsigned
i
=
0
;
(
frame
=
id3_tag_findframe
(
tag
,
id
,
i
))
!=
NULL
;
++
i
)
tag_id3_import_text_frame
(
dest
,
tag
,
frame
,
type
);
}
/**
* Import a "Comment frame" (ID3v2.4.0 section 4.10). It
* contains 4 fields:
*
...
...
@@ -180,16 +193,15 @@ tag_id3_import_text(struct tag *dest, struct id3_tag *tag, const char *id,
* - full string (we use this one)
*/
static
void
tag_id3_import_comment
(
struct
tag
*
dest
,
struct
id3_tag
*
tag
,
const
char
*
id
,
tag_id3_import_comment_frame
(
struct
tag
*
dest
,
struct
id3_tag
*
tag
,
const
struct
id3_frame
*
frame
,
enum
tag_type
type
)
{
struct
id3_frame
const
*
frame
;
id3_ucs4_t
const
*
ucs4
;
id3_utf8_t
*
utf8
;
union
id3_field
const
*
field
;
frame
=
id3_tag_findframe
(
tag
,
id
,
0
);
if
(
frame
==
NULL
||
frame
->
nfields
!=
4
)
if
(
frame
->
nfields
!=
4
)
return
;
/* for now I only read the 4th field, with the fullstring */
...
...
@@ -210,6 +222,20 @@ tag_id3_import_comment(struct tag *dest, struct id3_tag *tag, const char *id,
}
/**
* Import all comment frames (ID3v2.4.0 section 4.10). This is a
* wrapper for tag_id3_import_comment_frame().
*/
static
void
tag_id3_import_comment
(
struct
tag
*
dest
,
struct
id3_tag
*
tag
,
const
char
*
id
,
enum
tag_type
type
)
{
const
struct
id3_frame
*
frame
;
for
(
unsigned
i
=
0
;
(
frame
=
id3_tag_findframe
(
tag
,
id
,
i
))
!=
NULL
;
++
i
)
tag_id3_import_comment_frame
(
dest
,
tag
,
frame
,
type
);
}
/**
* Parse a TXXX name, and convert it to a tag_type enum value.
* Returns TAG_NUM_OF_ITEM_TYPES if the TXXX name is not understood.
*/
...
...
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