Optimize the SynchData::decode

Daniel Önnerby doep at onnerby.se
Fri Mar 21 00:31:48 CET 2008

Hi again!

I have some mp3s using id3v2 tags that seems to be unsyncronized (I do 
not really know what that means). They have a thumbnail embedded (APIC) 
and when I open the file with
TagLib::MPEG::File mp3file("myfile.mp3");
It will take a VERY long time (between 15-30 seconds) to read the tags. 
I tracked down what took so long and found that it was the 
SynchData::decode method when it decodes the APIC frame that in my 
example is about 300Kb.

I think this kind of "slow" files are very uncommon, but since we are 
writing a application that's suppose to handle your mp3 library it would 
be nice if this could be optimized.
Is this something that someone else has come across or has anyone 
already optimized this?

Best regards

More information about the taglib-devel mailing list