Skip to content

Commit

Permalink
Don't lead the scanned blocks on save
Browse files Browse the repository at this point in the history
  • Loading branch information
scotchi committed May 9, 2011
1 parent 6b7ed4a commit efeccbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion taglib/flac/flacfile.cpp
Expand Up @@ -161,10 +161,12 @@ bool FLAC::File::save()
MetadataBlock *block = d->blocks[i];
if(block->code() == MetadataBlock::VorbisComment) {
// Set the new Vorbis Comment block
delete block;
block = new UnknownMetadataBlock(MetadataBlock::VorbisComment, d->xiphCommentData);
foundVorbisCommentBlock = true;
}
if(block->code() == MetadataBlock::Padding) {
delete block;
continue;
}
newBlocks.append(block);
Expand All @@ -190,7 +192,7 @@ bool FLAC::File::save()
// Adjust the padding block(s)

long originalLength = d->streamStart - d->flacStart;
int paddingLength = originalLength - data.size() - 4;
int paddingLength = originalLength - data.size() - 4;
if (paddingLength < 0) {
paddingLength = MinPaddingLength;
}
Expand Down

0 comments on commit efeccbf

Please sign in to comment.