Avoid overwriting the audio stream when adding an ID3v1 tag to a FLAC file.

This commit is contained in:
Tsuda Kageyu 2015-06-18 19:27:21 +09:00
parent f830177b3b
commit fa17b4da6b

View File

@ -258,8 +258,16 @@ bool FLAC::File::save()
}
if(ID3v1Tag()) {
seek(-128, End);
if(d->hasID3v1) {
seek(d->ID3v1Location);
}
else {
seek(0, End);
d->ID3v1Location = tell();
}
writeBlock(ID3v1Tag()->render());
d->hasID3v1 = true;
}
return true;