APETag parsing in MPEGfile.cpp

harish jenny harishjennykn at yahoo.com
Thu Aug 22 12:48:52 UTC 2013


Hi,

I have a file which has APEtag as well as Id3V1 tag.

However , MPEG::File::findAPE() function is not able to detect APE footerLocation.

When I add the code something like - 

    seek(d->hasID3v1 ? -160 : -32, End);

    long p = tell();

    if(readBlock(8) == APE::Tag::fileIdentifier()) {
      d->APEFooterLocation = p;
      seek(d->APEFooterLocation);
      APE::Footer footer(readBlock(APE::Footer::size()));
      d->APELocation = d->APEFooterLocation - footer.completeTagSize()
    + APE::Footer::size();
      return;
    }
  ++  else
  ++  {
  ++      seek(!d->hasID3v1 ? -160 : -32, End);

++       long p = tell();

++        if(readBlock(8) == APE::Tag::fileIdentifier()) {
++          d->APEFooterLocation = p;
++          seek(d->APEFooterLocation);
++          APE::Footer footer(readBlock(APE::Footer::size()));
++          d->APELocation = d->APEFooterLocation - footer.completeTagSize()
++        + APE::Footer::size();
++          return;
++        }
++    }

it is able to parse APEtag. 

Does the standard say , if ID3V1 tag is present , then check for APETAGEX in -160 location from end ?

Is it fine to parse again from -32 location since I was able to find proper metadata?


Thanks & Regards,
Harish Jenny K N
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20130822/ba9b1601/attachment.html>


More information about the taglib-devel mailing list