Only the first ID3v2 frame can be accessed

Gabriel Burca gburca-taglib at ebixio.com
Sun Jan 6 05:33:23 CET 2008


I tried using taglib version 1.4 to read all the frames in an MP3 ID3v2 tag, but
was only able to obtain the first frame. Searching for some sample code on-line
I found tagdump2.cpp which also seems to only display the first frame. Is this a
known issue, or is there an error in my (and the tagdump2 author's) usage of the
library?

The tagdump2 file can be found at:
http://prokyon3.cvs.sourceforge.net/prokyon3/prokyon3/tools/tagdump2.cpp?revision=1.3&view=markup

My code does essentially the same thing:

TagLib::MPEG::File mp(filePath);
TagLib::ID3v2::FrameList allFrames = mp.ID3v2Tag()->frameList();
cout << "Frames found: " << allFrames.size()); // Always reports just 1 frame
std::list<TagLib::ID3v2::Frame *>::iterator iter = allFrames.begin();
while (iter != allFrames.end()) {
    // Show frame contents
    iter++;
}

If I remove the first frame from the mp3 file, the code will show me the next
one, but always just one frame. The frameList() call seems to only return a
1-element list.

-- 
Gabriel Burca - gburca dash taglib at ebixio dot com



More information about the taglib-devel mailing list