Don't ignore unsynchronisation flags in ID3v2 tag and frame headers

Lukáš Lalinský lalinsky at gmail.com
Tue Nov 6 15:11:43 CET 2007


On Ut, 2007-11-06 at 14:55 +0100, Scott Wheeler wrote:
> Specifically it's a binary / source incompatible API change, which
> shouldn't go in as it is.  The only problem that I see at the moment is
> to the createFrame method.  The old version needs to be supported, even
> if it is marked as deprecated.  TagLib is still binary compatible back
> to TagLib 1.0.
> 
> If you leave the old one in place though, I'm fine with this being
> checked in.

Hm, what do you mean? The old one still is there and is redirected to
the new one. Since there are three similar methods with similar
comments, the diff is little bit confusing, here is an excerpt from
id3v2framefactory.h:

      /*!
       * Create a frame based on \a data.  \a synchSafeInts should only
be set
       * false if we are parsing an old tag (v2.3 or older) that does
not support
       * synchsafe ints.
       *
       * \deprecated Please use the method below that accepts a
ID3v2::Header
       * instance in new code.
       */
      Frame *createFrame(const ByteVector &data, bool synchSafeInts)
const;

      /*!
       * Create a frame based on \a data.  \a version should indicate
the ID3v2
       * version of the tag.  As ID3v2.4 is the most current version of
the
       * standard 4 is the default.
       *
       * \deprecated Please use the method below that accepts a
ID3v2::Header
       * instance in new code.
       */
      Frame *createFrame(const ByteVector &data, uint version = 4)
const;

      /*!
       * Create a frame based on \a data.  \a tagHeader should be a
valid
       * ID3v2::Header instance.
       */
      // BIC: make virtual
      Frame *createFrame(const ByteVector &data, Header *tagHeader)
const;

And in id3v2framefactory.cpp:

Frame *FrameFactory::createFrame(const ByteVector &data, uint version)
const
{
  Header tagHeader;
  tagHeader.setMajorVersion(version);
  return createFrame(data, &tagHeader);
}


Lukas




More information about the taglib-devel mailing list