Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I've recently encountered the wrong MP3 length being reported when a xing header is present. Could it be that we should be looking for the "Info" string to signify the start of the xing header as well as the "Xing" string, whichever comes first? I suppose the check would be added here.
It seems from this post that the Xing header ID can be either 'Xing' or 'Info'. If we look at the file you've attached, we can see the 'Info' identifier occurs nearer to the start of the file than the 'Xing' string and appears to have the correct information.
Checking for both 'Info' and 'Xing', whichever appears first, should solve this issue without having to be picky about the 'Xing' position.
I did not open that other ticket.
The file belongs to a client so I am not allowed to share it, unfortunately. If you want me to test any patches, I can definitely do that.
Do you know if there are any official specs for this information? The best resources I've seemed to find are the link in the previous comment and this one, which states:
I'm unfamiliar with the MP3 spec, but is the xing header always expected to be in the same location in the file, or can it be anywhere within the first 32764 bytes as the mutagen code suggests?
mp3: rework Xing/VBRI header parsing to be more strict; parse LAME Xing headers; extract the bitrate info from VBRI headers. (Fixes issue # 182)
Instead of scanning the file from the guessed offset and searching
While at it also read lame Xing headers which start with "Info" but are