aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/oggvorbis_plugin.c
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2006-04-30 19:55:56 +0000
committerQball Cow <qball@qballcow.nl>2006-04-30 19:55:56 +0000
commit4324150b42ea7720629b74014401119754429b04 (patch)
treeb2366f2caf7e0e1f9d3b8d56ee61d8c6772122e0 /src/inputPlugins/oggvorbis_plugin.c
parent8aca530b863a54deab7b204e21a9b1396ace34b3 (diff)
downloadmpd-4324150b42ea7720629b74014401119754429b04.tar.gz
mpd-4324150b42ea7720629b74014401119754429b04.tar.xz
mpd-4324150b42ea7720629b74014401119754429b04.zip
Added Disc # metadata item based on bug 571 (added id3v2 support)
git-svn-id: https://svn.musicpd.org/mpd/trunk@4131 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/oggvorbis_plugin.c')
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index aa094856e..6881b9c41 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -155,12 +155,17 @@ void ogg_getReplayGainInfo(char ** comments, ReplayGainInfo ** infoPtr) {
}
static const char * VORBIS_COMMENT_TRACK_KEY = "tracknumber";
+static const char * VORBIS_COMMENT_DISC_KEY = "discnumber";
static inline unsigned int ogg_parseCommentAddToTag(char * comment,
unsigned int itemType, MpdTag ** tag)
{
- const char * needle = (itemType == TAG_ITEM_TRACK) ?
- VORBIS_COMMENT_TRACK_KEY : mpdTagItemKeys[itemType];
+ const char * needle;
+ switch (itemType) {
+ case TAG_ITEM_TRACK: needle = VORBIS_COMMENT_TRACK_KEY; break;
+ case TAG_ITEM_DISC: needle = VORBIS_COMMENT_DISC_KEY; break;
+ default: needle = mpdTagItemKeys[itemType];
+ }
unsigned int len = strlen(needle);
if(strncasecmp(comment, needle, len) == 0 && *(comment+len) == '=') {