[PATCH] Add support for CBR Xing headers

Xavier Duret xaviour.maillists at gmail.com
Wed Jan 17 20:51:46 CET 2007


This patch adds support for "Info" headers. This type of header is
used in CBR files. It contains the number of frames in the file which
allows calculating the song duration more accurately than by using
other techniques.


diff -ruN taglib.old/taglib/mpeg/xingheader.cpp
taglib/taglib/mpeg/xingheader.cpp
--- taglib.old/taglib/mpeg/xingheader.cpp       2007-01-17
16:01:31.000000000 +0100
+++ taglib/taglib/mpeg/xingheader.cpp   2007-01-17 19:25:56.000000000 +0100
@@ -88,7 +88,7 @@
 {
   // Check to see if a valid Xing header is available.

-  if(!data.startsWith("Xing"))
+  if(!data.startsWith("Xing") && !data.startsWith("Info"))
     return;

   // If the XingHeader doesn't contain the number of frames and the
total stream


More information about the taglib-devel mailing list