<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 7:48 AM, harish jenny <span dir="ltr"><<a href="mailto:harishjennykn@yahoo.com" target="_blank">harishjennykn@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:'times new roman','new york',times,serif">
Hi,<br><br>I have a file which has APEtag as well as Id3V1 tag.<br><br>However , <span style="font-weight:bold">MPEG::File::findAPE()</span> function is not able to detect APE footerLocation.<br><br>When I add the code something like - <br>
<br> seek(d->hasID3v1 ? -160 : -32, End);<br><br> long p = tell();<br><br> if(readBlock(8) == APE::Tag::fileIdentifier()) {<br> d->APEFooterLocation = p;<br> seek(d->APEFooterLocation);<br> APE::Footer footer(readBlock(APE::Footer::size()));<br>
d->APELocation = d->APEFooterLocation - footer.completeTagSize()<br> + APE::Footer::size();<br>
return;<br> }<span style="font-weight:bold"><br> ++ else<br> ++ {<br> ++ seek(!d->hasID3v1 ? -160 : -32, End);<br><br>++ long p = tell();<br><br>++ if(readBlock(8) == APE::Tag::fileIdentifier()) {<br>
++ d->APEFooterLocation = p;<br>++ seek(d->APEFooterLocation);<br>++ APE::Footer footer(readBlock(APE::Footer::size()));<br>++ d->APELocation = d->APEFooterLocation - footer.completeTagSize()<br>
++ + APE::Footer::size();<br>++ return;<br>++ }<br>++ }</span><br><br>it is
able to parse APEtag. <br><br>Does the standard say , if ID3V1 tag is present , then check for APETAGEX in -160 location from end ?<br></div></div></blockquote><div><br></div><div><br></div><div>According to this:</div>
<div><a href="http://wiki.hydrogenaudio.org/index.php?title=APEv2_specification" target="_blank">http://wiki.hydrogenaudio.org/index.php?title=APEv2_specification</a><br></div><div><br></div><div>The id3v1 tag should come last. I don't think you'll find many players that can support a id3v1 tag not located at the end. </div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:'times new roman','new york',times,serif">
Is it fine to parse again from -32 location since I was able to find proper metadata?<br></div></div></blockquote><div><br></div><div>No, as a matter of fact, if you can read a id3v1 tag at -128 and read a apetag at -32, it means the file is most likely broken (ie. overlapping tags, id3v1 is truncated by the apetag).<br>
</div><div><br></div><div>Cheers,</div><div><br></div><div>Sander</div><div><br></div><div> </div></div></div></div>