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
cfcd8465
Commit
cfcd8465
authored
Jun 30, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mp4ff: use tag_table.h to parse tag names
Convert if/else/else/... to a loop.
parent
5092eaf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
mp4ff_plugin.c
src/decoder/mp4ff_plugin.c
+15
-18
No files found.
src/decoder/mp4ff_plugin.c
View file @
cfcd8465
...
...
@@ -19,6 +19,7 @@
#include "../decoder_api.h"
#include "config.h"
#include "tag_table.h"
#include <glib.h>
...
...
@@ -339,6 +340,17 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
mp4ff_close
(
mp4fh
);
}
static
const
char
*
const
mp4ff_tag_names
[
TAG_NUM_OF_ITEM_TYPES
]
=
{
[
TAG_ITEM_TITLE
]
=
"title"
,
[
TAG_ITEM_ARTIST
]
=
"artist"
,
[
TAG_ITEM_ALBUM
]
=
"album"
,
[
TAG_ITEM_TRACK
]
=
"track"
,
[
TAG_ITEM_DISC
]
=
"disc"
,
[
TAG_ITEM_GENRE
]
=
"genre"
,
[
TAG_ITEM_DATE
]
=
"date"
,
[
TAG_ITEM_COMPOSER
]
=
"writer"
,
};
static
struct
tag
*
mp4_tag_dup
(
const
char
*
file
)
{
...
...
@@ -394,24 +406,9 @@ mp4_tag_dup(const char *file)
mp4ff_meta_get_by_index
(
mp4fh
,
i
,
&
item
,
&
value
);
if
(
0
==
g_ascii_strcasecmp
(
"artist"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_ARTIST
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"title"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_TITLE
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"album"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_ALBUM
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"track"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_TRACK
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"disc"
,
item
))
{
/* Is that the correct id? */
tag_add_item
(
ret
,
TAG_ITEM_DISC
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"genre"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_GENRE
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"date"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_DATE
,
value
);
}
else
if
(
0
==
g_ascii_strcasecmp
(
"writer"
,
item
))
{
tag_add_item
(
ret
,
TAG_ITEM_COMPOSER
,
value
);
}
enum
tag_type
type
=
tag_table_lookup
(
mp4ff_tag_names
,
item
);
if
(
type
!=
TAG_NUM_OF_ITEM_TYPES
)
tag_add_item
(
ret
,
type
,
value
);
free
(
item
);
free
(
value
);
...
...
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