diff --git a/flac/flacfile.cpp b/flac/flacfile.cpp index 50fa324b..b8315ee4 100644 --- a/flac/flacfile.cpp +++ b/flac/flacfile.cpp @@ -132,7 +132,7 @@ void FLAC::File::save() Tag::duplicate(d->tag, d->comment, true); } - d->xiphCommentData = d->comment->render(); + d->xiphCommentData = d->comment->render(false); ByteVector v = ByteVector::fromUInt(d->xiphCommentData.size()); diff --git a/ogg/xiphcomment.cpp b/ogg/xiphcomment.cpp index 2e781bcb..62c45ec4 100644 --- a/ogg/xiphcomment.cpp +++ b/ogg/xiphcomment.cpp @@ -197,6 +197,11 @@ void Ogg::XiphComment::removeField(const String &key, const String &value) } ByteVector Ogg::XiphComment::render() const +{ + return render(true); +} + +ByteVector Ogg::XiphComment::render(bool addFramingBit) const { ByteVector data; @@ -238,8 +243,9 @@ ByteVector Ogg::XiphComment::render() const } // Append the "framing bit". - - data.append(char(1)); + + if(addFramingBit) + data.append(char(1)); return data; } diff --git a/ogg/xiphcomment.h b/ogg/xiphcomment.h index 6e899fa1..dbcde9d5 100644 --- a/ogg/xiphcomment.h +++ b/ogg/xiphcomment.h @@ -159,7 +159,16 @@ namespace TagLib { /*! * Renders the comment to a ByteVector suitable for inserting into a file. */ - ByteVector render() const; + ByteVector render() const; // BIC: remove and merge with below + + /*! + * Renders the comment to a ByteVector suitable for inserting into a file. + * + * If \a addFramingBit is true the standard Vorbis comment framing bit will + * be appended. However some formats (notably FLAC) do not work with this + * in place. + */ + ByteVector render(bool addFramingBit) const; protected: /*!