Is there a way in TagLib to detect whether or not an ID3v1 tag exists or not in an MPEG file? The isEmpty function checks whether or not any specific tags (album, year, etc.) exist, but not whether the id3v1 block itself is there. See this entry in the TagLib documentation:<div>
<br></div><div><a href="http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1MPEG_1_1File.html#7ae340bcd74f74289fc4f0cdba8c2bd5">http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1MPEG_1_1File.html#7ae340bcd74f74289fc4f0cdba8c2bd5</a></div>
<div><br></div><div><a href="http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1MPEG_1_1File.html#7ae340bcd74f74289fc4f0cdba8c2bd5"></a>This says it will return a NULL pointer if there is no id3v1 tag found. This doesn&#39;t happen. For example, I ran an MP3 through the strip-id3v1 program in the examples. I then ran this same mp3 through my own program that tells me if the pointer id3v1 tag object is NULL. The pointer returned is not NULL. Does TagLib have its own special definition for a NULL pointer? Is this a bug? What could I be doing wrong?</div>
<div><br></div><div>Here is my code.</div><div><br></div><div>TagLib<span style=" color:#000000;">::</span>MPEG<span style=" color:#000000;">::</span>File<span style=" color:#c0c0c0;"> </span>file<span style=" color:#000000;">(</span>filePath<span style=" color:#000000;">);</span></div>
<div><span style=" color:#000000;"></span>TagLib<span style=" color:#000000;">::</span>ID3v1<span style=" color:#000000;">::</span>Tag<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span>id3v1<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span>file<span style=" color:#000000;">.</span>ID3v1Tag<span style=" color:#000000;">();</span></div>
<div><span style=" color:#000000;"><div>if(id3v1 == NULL)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>qDebug() &lt;&lt; &quot;null&quot;;</div><div>}</div></span></div><div><span style=" color:#000000;"></span><br>
<div><div><br></div>Joel Verhagen<br>
</div></div>