Always read tags from the first Vorbis Comment block in FLAC files

Prevously TagLib saved tags to the first block, but read them from the
last one. Having multiple VC blocks is a non-standard situation, but
this is the best we can do (libFLAC also uses the first block in the
case of multiple VC blocks). 

BUG:211089


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1043985 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský
2009-11-02 19:41:12 +00:00
parent 2039c725f4
commit c962d78a57
4 changed files with 48 additions and 3 deletions

View File

@ -406,7 +406,6 @@ void FLAC::File::scan()
nextBlockOffset += length + 4;
// Search through the remaining metadata
while(!isLastBlock) {
header = readBlock(4);
@ -416,8 +415,13 @@ void FLAC::File::scan()
// Found the vorbis-comment
if(blockType == VorbisComment) {
d->xiphCommentData = readBlock(length);
d->hasXiphComment = true;
if(!d->hasXiphComment) {
d->xiphCommentData = readBlock(length);
d->hasXiphComment = true;
}
else {
debug("FLAC::File::scan() -- multiple Vorbis Comment blocks found, using the first one");
}
}
nextBlockOffset += length + 4;