Using isNull()

Andrew Gatt andrew.gatt at
Tue Sep 6 13:18:09 CEST 2005


I'm trying to write a program to automatically sort through files. I need to know if there is a valid header on the mp3 file, but using isNull() seems to return false even when there is no header,

TagLib::FileRef f(path);
if (f.isNull()) return -1;

giving out this error, but still returning not null.

TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream

After this,

TagLib::Tag *tag = f.tag();
	if(tag) {

also returns true, and so my program prints out all the properties even though they are empty. How do i find out if there is no header in the first place? Or do i have to access the actual file pointer inside the mpeg class and use isValid()?



More information about the taglib-devel mailing list