[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/taglib
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2004-05-04 1:47:01
Message-ID: 20040504014701.763BE9A05 () office ! kde ! org
[Download RAW message or body]

CVS commit by wheeler: 

Don't append a framing bit when writing Xiph comments to FLAC files since this
renders them unplayable with some players.  Thanks to Jason Lee for tracking
this down!

CCMAIL:75880-done@bugs.kde.org


  M +1 -1      flac/flacfile.cpp   1.11
  M +8 -2      ogg/xiphcomment.cpp   1.14
  M +10 -1     ogg/xiphcomment.h   1.14


--- kdesupport/taglib/flac/flacfile.cpp  #1.10:1.11
@@ -133,5 +133,5 @@ void FLAC::File::save()
   }
 
-  d->xiphCommentData = d->comment->render();
+  d->xiphCommentData = d->comment->render(false);
 
   ByteVector v = ByteVector::fromUInt(d->xiphCommentData.size());

--- kdesupport/taglib/ogg/xiphcomment.cpp  #1.13:1.14
@@ -199,4 +199,9 @@ void Ogg::XiphComment::removeField(const
 ByteVector Ogg::XiphComment::render() const
 {
+  return render(true);
+}
+
+ByteVector Ogg::XiphComment::render(bool addFramingBit) const
+{
   ByteVector data;
 
@@ -240,4 +245,5 @@ ByteVector Ogg::XiphComment::render() co
   // Append the "framing bit".
 
+  if(addFramingBit)
   data.append(char(1));
 

--- kdesupport/taglib/ogg/xiphcomment.h  #1.13:1.14
@@ -160,5 +160,14 @@ 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:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic