ogg voribs comment parsing on the fly in the decoder

git-svn-id: https://svn.musicpd.org/mpd/trunk@1279 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2004-06-01 11:18:25 +00:00
parent 187eba5754
commit fe0b751c82
6 changed files with 111 additions and 35 deletions

View File

@@ -56,6 +56,8 @@ static void resetPlayerMetadata() {
if(pc->metadataState == PLAYER_METADATA_STATE_READ) {
pc->metadataState = PLAYER_METADATA_STATE_WRITE;
pc->title = -1;
pc->artist = -1;
pc->album = -1;
}
}
@@ -489,6 +491,12 @@ Song * playerCurrentDecodeSong() {
if(pc->title >= 0) {
song->tag->title = strdup(pc->title + pc->metadata);
}
if(pc->artist >= 0) {
song->tag->artist = strdup(pc->artist + pc->metadata);
}
if(pc->album >= 0) {
song->tag->album = strdup(pc->album + pc->metadata);
}
validateUtf8Tag(song->tag);
resetPlayerMetadata();
return song;