tmkk/XLDFdkAacOutput — pull request #3 by kode54 (2013-08-14 04:05:52+00:00)
Title: Corrected delay and padding properly, according to recent iTunes

Sorry, I got that last commit wrong. :(

I found that discussion on Hydrogen Audio thanks to another helpful poster, having earlier confirmed the 962 samples myself through examination of the rerouted playback of iTunes. I then found the difference of iTunes including 180 extra samples worth of silence on the beginning of HEv2/SBR+PS files, which resulted in the final calculation of subtracting 391 samples from the halved delay which fdk-aac already computed for us, or 481 from HEv1/SBR files.

I hope I got it right this time. Now I hope I can get more people on HA.org to wake up to the discussion and maybe bring their respective players in line with this design logic that Apple seems to have chosen for their gapless information, as both Winamp and foobar2000 assume these delays are included in the header field, and Winamp's HEv1 encoder computes this header field as such when converting files. If either player changes, then they still have to contend with all the files Winamp has encoded which would be broken by the change.