Update APE location after adding new tags.

BUG:122700


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@689608 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2007-07-18 17:08:09 +00:00
parent 183060d729
commit fb0d6c5b4e

View File

@ -304,6 +304,18 @@ bool MPEG::File::save(int tags, bool stripOthers)
d->ID3v2Location = 0;
insert(d->ID3v2Tag->render(), d->ID3v2Location, d->ID3v2OriginalSize);
d->hasID3v2 = true;
// v1 tag location has changed, update if it exists
if(d->ID3v1Tag)
d->ID3v1Location = findID3v1();
// APE tag location has changed, update if it exists
if(d->APETag)
d->APELocation = findAPE();
}
else if(stripOthers)
success = strip(ID3v2, false) && success;
@ -316,6 +328,8 @@ bool MPEG::File::save(int tags, bool stripOthers)
int offset = d->hasID3v1 ? -128 : 0;
seek(offset, End);
writeBlock(d->ID3v1Tag->render());
d->hasID3v1 = true;
d->ID3v1Location = findID3v1();
}
else if(stripOthers)
success = strip(ID3v1) && success;
@ -407,8 +421,14 @@ bool MPEG::File::strip(int tags, bool freeMemory)
}
// v1 tag location has changed, update if it exists
if(d->ID3v1Tag)
d->ID3v1Location = findID3v1();
// APE tag location has changed, update if it exists
if(d->APETag)
d->APELocation = findAPE();
}
if((tags & ID3v1) && d->hasID3v1) {