upgraded taglib to version 1.5

This commit is contained in:
fgerlits 2009-05-01 19:58:31 +00:00
parent c0f83fc84c
commit aee5a86f65
13 changed files with 140 additions and 185 deletions

View File

@ -153,7 +153,7 @@ xmlrpcxx_version=xmlrpc++-20040713
xmlrpcxx_tmpdir=$tools_tmpdir/xmlrpc++ xmlrpcxx_tmpdir=$tools_tmpdir/xmlrpc++
taglib_dir=$toolsdir/taglib taglib_dir=$toolsdir/taglib
taglib_version=taglib-1.4 taglib_version=taglib-1.5
taglib_tmpdir=$tools_tmpdir/taglib taglib_tmpdir=$tools_tmpdir/taglib
pear_dir=$toolsdir/pear pear_dir=$toolsdir/pear

View File

@ -106,7 +106,7 @@ LIBODBCXX_VERSION = libodbc++-0.2.4pre4
XMLRPCXX_DIR = ${TOOLS_DIR}/xmlrpc++ XMLRPCXX_DIR = ${TOOLS_DIR}/xmlrpc++
XMLRPCXX_VERSION = xmlrpc++-20040713 XMLRPCXX_VERSION = xmlrpc++-20040713
TAGLIB_DIR = ${TOOLS_DIR}/taglib TAGLIB_DIR = ${TOOLS_DIR}/taglib
TAGLIB_VERSION = taglib-1.4 TAGLIB_VERSION = taglib-1.5
PEAR_DIR = ${TOOLS_DIR}/pear PEAR_DIR = ${TOOLS_DIR}/pear
MODULES_DIR = ${SRC_DIR}/modules MODULES_DIR = ${SRC_DIR}/modules

View File

@ -355,9 +355,9 @@ AC_MSG_NOTICE(
[compiling the following external libraries that are needed [compiling the following external libraries that are needed
by Campcaster: by Campcaster:
libodbc++ 0.2.4pre4 yes libodbc++ 0.2.4pre4
taglib 1.4 yes taglib 1.5
xmlrpc++ 2004-07-13 yes xmlrpc++ 2004-07-13
using the following configuration settings: using the following configuration settings:

View File

@ -1,172 +0,0 @@
--- taglib-1.3.1/taglib/audioproperties.h 2003-11-04 03:48:25.000000000 +0100
+++ taglib-1.3.1-microseconds/taglib/audioproperties.h 2005-06-15 19:27:31.805943362 +0200
@@ -59,11 +59,16 @@
virtual ~AudioProperties();
/*!
- * Returns the lenght of the file in seconds.
+ * Returns the length of the file in seconds (rounded down).
*/
virtual int length() const = 0;
/*!
+ * Returns the fractional part of the length of the file, in microseconds.
+ */
+ virtual int length_microseconds() const = 0;
+
+ /*!
* Returns the most appropriate bit rate for the file in kb/s. For constant
* bitrate formats this is simply the bitrate of the file. For variable
* bitrate formats this is either the average or nominal bitrate.
--- taglib-1.3.1/taglib/flac/flacproperties.h 2004-06-24 21:27:02.000000000 +0200
+++ taglib-1.3.1-microseconds/taglib/flac/flacproperties.h 2005-06-15 19:41:27.176791223 +0200
@@ -62,6 +62,7 @@
// Reimplementations.
virtual int length() const;
+ virtual int length_microseconds() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;
--- taglib-1.3.1/taglib/flac/flacproperties.cpp 2004-08-02 16:18:58.000000000 +0200
+++ taglib-1.3.1-microseconds/taglib/flac/flacproperties.cpp 2005-06-15 21:42:48.714138847 +0200
@@ -76,6 +76,11 @@
return d->length;
}
+int FLAC::Properties::length_microseconds() const
+{
+ return 0;
+}
+
int FLAC::Properties::bitrate() const
{
return d->bitrate;
--- taglib-1.3.1/taglib/mpc/mpcproperties.h 2004-07-21 00:30:00.000000000 +0200
+++ taglib-1.3.1-microseconds/taglib/mpc/mpcproperties.h 2005-06-15 19:46:10.845016974 +0200
@@ -56,6 +56,7 @@
// Reimplementations.
virtual int length() const;
+ virtual int length_microseconds() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;
--- taglib-1.3.1/taglib/mpc/mpcproperties.cpp 2004-09-09 02:28:18.000000000 +0200
+++ taglib-1.3.1-microseconds/taglib/mpc/mpcproperties.cpp 2005-06-15 21:43:14.322020672 +0200
@@ -71,6 +71,11 @@
return d->length;
}
+int MPC::Properties::length_microseconds() const
+{
+ return 0;
+}
+
int MPC::Properties::bitrate() const
{
return d->bitrate;
--- taglib-1.3.1/taglib/mpeg/mpegproperties.h 2003-11-05 05:29:05.000000000 +0100
+++ taglib-1.3.1-microseconds/taglib/mpeg/mpegproperties.h 2005-06-15 19:33:00.669147926 +0200
@@ -56,6 +56,7 @@
// Reimplementations.
virtual int length() const;
+ virtual int length_microseconds() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;
--- taglib-1.3.1/taglib/mpeg/mpegproperties.cpp 2004-08-02 16:18:58.000000000 +0200
+++ taglib-1.3.1-microseconds/taglib/mpeg/mpegproperties.cpp 2005-06-15 20:57:14.538631543 +0200
@@ -41,7 +41,7 @@
File *file;
ReadStyle style;
- int length;
+ long long length;
int bitrate;
int sampleRate;
int channels;
@@ -71,7 +71,12 @@
int MPEG::Properties::length() const
{
- return d->length;
+ return int(d->length / 1000000);
+}
+
+int MPEG::Properties::length_microseconds() const
+{
+ return int(d->length % 1000000);
}
int MPEG::Properties::bitrate() const
@@ -191,8 +196,9 @@
double timePerFrame = blockSize[firstHeader.layer()];
timePerFrame = firstHeader.sampleRate() > 0 ? timePerFrame / firstHeader.sampleRate() : 0;
- d->length = int(timePerFrame * xingHeader.totalFrames());
- d->bitrate = d->length > 0 ? xingHeader.totalSize() * 8 / d->length / 1000 : 0;
+ d->length = (long long)(
+ timePerFrame * xingHeader.totalFrames() * 1000000 + 0.5);
+ d->bitrate = d->length > 0 ? xingHeader.totalSize() * 8000 / d->length : 0;
}
// Since there was no valid Xing header found, we hope that we're in a constant
@@ -204,8 +210,10 @@
else if(firstHeader.frameLength() > 0 && firstHeader.bitrate() > 0) {
int frames = (last - first) / firstHeader.frameLength() + 1;
- d->length = int(float(firstHeader.frameLength() * frames) /
- float(firstHeader.bitrate() * 125) + 0.5);
+ d->length = (long long)(
+ (double(firstHeader.frameLength()) * frames * 1000000) /
+ (double(firstHeader.bitrate()) * 125) + 0.5);
+
d->bitrate = firstHeader.bitrate();
}
--- taglib-1.3.1/taglib/ogg/vorbis/vorbisproperties.h 2004-05-13 02:29:48.000000000 +0200
+++ taglib-1.3.1-microseconds/taglib/ogg/vorbis/vorbisproperties.h 2005-06-15 19:48:18.365492520 +0200
@@ -65,6 +65,7 @@
// Reimplementations.
virtual int length() const;
+ virtual int length_microseconds() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;
--- taglib-1.3.1/taglib/ogg/vorbis/vorbisproperties.cpp 2003-12-02 06:00:23.000000000 +0100
+++ taglib-1.3.1-microseconds/taglib/ogg/vorbis/vorbisproperties.cpp 2005-06-15 20:36:41.687062239 +0200
@@ -46,7 +46,7 @@
File *file;
ReadStyle style;
- int length;
+ long long length;
int bitrate;
int sampleRate;
int channels;
@@ -81,7 +81,12 @@
int Vorbis::Properties::length() const
{
- return d->length;
+ return int(d->length / 1000000);
+}
+
+int Vorbis::Properties::length_microseconds() const
+{
+ return int(d->length % 1000000);
}
int Vorbis::Properties::bitrate() const
@@ -169,7 +174,7 @@
long long end = last->absoluteGranularPosition();
if(start >= 0 && end >= 0 && d->sampleRate > 0)
- d->length = (end - start) / (long long) d->sampleRate;
+ d->length = ((end - start) * 1000000) / (long long) d->sampleRate;
else
debug("Vorbis::Properties::read() -- Either the PCM values for the start or "
"end of this file was incorrect or the sample rate is zero.");

View File

@ -30,7 +30,7 @@
# For more information on taglib, # For more information on taglib,
# see http://freshmeat.net/redir/taglib/47265/url_homepage/taglib # see http://freshmeat.net/redir/taglib/47265/url_homepage/taglib
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
product=taglib-1.4 product=taglib-1.5
reldir=`dirname $0`/.. reldir=`dirname $0`/..
basedir=`cd ${reldir}; pwd;` basedir=`cd ${reldir}; pwd;`
@ -48,6 +48,6 @@ if [ ! -d $product ]; then
cd $product cd $product
# see https://bugs.kde.org/show_bug.cgi?id=112728 # see https://bugs.kde.org/show_bug.cgi?id=112728
# and http://mail.kde.org/pipermail/taglib-devel/2005-June/000149.html # and http://mail.kde.org/pipermail/taglib-devel/2005-June/000149.html
patch -p1 < $etcdir/taglib-1.3.1-length-in-microseconds.patch patch -p1 < $etcdir/taglib-1.5-length-in-microseconds.patch
fi fi

View File

@ -49,7 +49,7 @@ COVERAGE_DIR = ${DOC_DIR}/coverage
ETC_DIR = ${BASE_DIR}/etc ETC_DIR = ${BASE_DIR}/etc
TMP_DIR = ${BASE_DIR}/tmp TMP_DIR = ${BASE_DIR}/tmp
TAGLIB_VERSION = taglib-1.4 TAGLIB_VERSION = taglib-1.5
TAGLIB_DIR = ${TMP_DIR}/${TAGLIB_VERSION} TAGLIB_DIR = ${TMP_DIR}/${TAGLIB_VERSION}
prefix = @prefix@ prefix = @prefix@
@ -66,7 +66,7 @@ ${TMP_DIR}/all.stamp:
${MAKE} -C ${TAGLIB_DIR} ${MAKE} -C ${TAGLIB_DIR}
# make the reference documentation and install that as well, as the # make the reference documentation and install that as well, as the
# autoconf thing doesn't :( # autoconf thing doesn't :(
cd ${TAGLIB_DIR}/taglib-api && ${DOXYGEN} taglib.doxygen cd ${TAGLIB_DIR}/doc && ${DOXYGEN} taglib.doxygen
touch ${TMP_DIR}/all.stamp touch ${TMP_DIR}/all.stamp
install: all ${TMP_DIR}/install.stamp install: all ${TMP_DIR}/install.stamp
@ -75,7 +75,7 @@ ${TMP_DIR}/install.stamp:
# make the reference documentation and install that as well, as the # make the reference documentation and install that as well, as the
# autoconf thing doesn't :( # autoconf thing doesn't :(
${MKDIR} ${docdir} ${MKDIR} ${docdir}
cp -pPR ${TAGLIB_DIR}/taglib-api/* ${docdir} cp -pPR ${TAGLIB_DIR}/doc/* ${docdir}
touch ${TMP_DIR}/install.stamp touch ${TMP_DIR}/install.stamp
clean: clean:

View File

@ -32,18 +32,18 @@ dnl This is due to the fact that configure spreads a lot of trash around,
dnl like atom4te cache directories, config.* files, etc. into the directory dnl like atom4te cache directories, config.* files, etc. into the directory
dnl it is being run from. We clearly don't want these in our base directory. dnl it is being run from. We clearly don't want these in our base directory.
dnl----------------------------------------------------------------------------- dnl-----------------------------------------------------------------------------
AC_INIT(taglib, 1.4, bugs@campware.org) AC_INIT(taglib, 1.5, bugs@campware.org)
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL]) AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL])
AC_REVISION($Revision$) AC_REVISION($Revision$)
AC_CONFIG_SRCDIR(../src/taglib-1.4.tar.gz) AC_CONFIG_SRCDIR(../src/taglib-1.5.tar.gz)
dnl untar the sources before anything happens dnl untar the sources before anything happens
../bin/prepare.sh ../bin/prepare.sh
cd ../tmp/taglib-1.4 cd ../tmp/taglib-1.5
./configure --prefix=$prefix ./configure --prefix=$prefix
cd - cd -

View File

@ -0,0 +1,127 @@
diff -ur taglib-1.5/taglib/audioproperties.h taglib-1.5-microseconds/taglib/audioproperties.h
--- taglib-1.5/taglib/audioproperties.h 2008-02-04 16:14:46.000000000 +0100
+++ taglib-1.5-microseconds/taglib/audioproperties.h 2009-05-01 21:19:11.000000000 +0200
@@ -65,10 +65,15 @@
virtual ~AudioProperties();
/*!
- * Returns the length of the file in seconds.
+ * Returns the length of the file in seconds (rounded down).
*/
virtual int length() const = 0;
+ /*!
+ * Returns the fractional part of the length of the file, in microseconds.
+ */
+ virtual int length_microseconds() const { return 0; }
+
/*!
* Returns the most appropriate bit rate for the file in kb/s. For constant
* bitrate formats this is simply the bitrate of the file. For variable
diff -ur taglib-1.5/taglib/mpeg/mpegproperties.cpp taglib-1.5-microseconds/taglib/mpeg/mpegproperties.cpp
--- taglib-1.5/taglib/mpeg/mpegproperties.cpp 2008-02-04 16:14:46.000000000 +0100
+++ taglib-1.5-microseconds/taglib/mpeg/mpegproperties.cpp 2009-05-01 21:22:36.000000000 +0200
@@ -58,7 +58,7 @@
File *file;
XingHeader *xingHeader;
ReadStyle style;
- int length;
+ long long length;
int bitrate;
int sampleRate;
int channels;
@@ -89,7 +89,12 @@
int MPEG::Properties::length() const
{
- return d->length;
+ return int(d->length / 1000000);
+}
+
+int MPEG::Properties::length_microseconds() const
+{
+ return int(d->length % 1000000);
}
int MPEG::Properties::bitrate() const
@@ -218,8 +223,9 @@
double timePerFrame =
double(firstHeader.samplesPerFrame()) / firstHeader.sampleRate();
- d->length = int(timePerFrame * d->xingHeader->totalFrames());
- d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / d->length / 1000 : 0;
+ d->length = (long long)(
+ timePerFrame * d->xingHeader->totalFrames() * 1000000 + 0.5);
+ d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8000 / d->length : 0;
}
else {
// Since there was no valid Xing header found, we hope that we're in a constant
@@ -234,8 +240,9 @@
if(firstHeader.frameLength() > 0 && firstHeader.bitrate() > 0) {
int frames = (last - first) / firstHeader.frameLength() + 1;
- d->length = int(float(firstHeader.frameLength() * frames) /
- float(firstHeader.bitrate() * 125) + 0.5);
+ d->length = (long long)(
+ (double(firstHeader.frameLength()) * frames * 1000000) /
+ (double(firstHeader.bitrate()) * 125) + 0.5);
d->bitrate = firstHeader.bitrate();
}
}
diff -ur taglib-1.5/taglib/mpeg/mpegproperties.h taglib-1.5-microseconds/taglib/mpeg/mpegproperties.h
--- taglib-1.5/taglib/mpeg/mpegproperties.h 2008-02-04 16:14:46.000000000 +0100
+++ taglib-1.5-microseconds/taglib/mpeg/mpegproperties.h 2009-05-01 18:52:04.000000000 +0200
@@ -62,6 +62,7 @@
// Reimplementations.
virtual int length() const;
+ virtual int length_microseconds() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;
diff -ur taglib-1.5/taglib/ogg/vorbis/vorbisproperties.cpp taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.cpp
--- taglib-1.5/taglib/ogg/vorbis/vorbisproperties.cpp 2008-02-04 16:14:46.000000000 +0100
+++ taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.cpp 2009-05-01 19:01:15.000000000 +0200
@@ -50,7 +50,7 @@
File *file;
ReadStyle style;
- int length;
+ long long length;
int bitrate;
int sampleRate;
int channels;
@@ -85,7 +85,12 @@
int Vorbis::Properties::length() const
{
- return d->length;
+ return int(d->length / 1000000);
+}
+
+int Vorbis::Properties::length_microseconds() const
+{
+ return int(d->length % 1000000);
}
int Vorbis::Properties::bitrate() const
@@ -173,7 +178,7 @@
long long end = last->absoluteGranularPosition();
if(start >= 0 && end >= 0 && d->sampleRate > 0)
- d->length = (end - start) / (long long) d->sampleRate;
+ d->length = ((end - start) * 1000000) / (long long) d->sampleRate;
else
debug("Vorbis::Properties::read() -- Either the PCM values for the start or "
"end of this file was incorrect or the sample rate is zero.");
diff -ur taglib-1.5/taglib/ogg/vorbis/vorbisproperties.h taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.h
--- taglib-1.5/taglib/ogg/vorbis/vorbisproperties.h 2008-02-04 16:14:46.000000000 +0100
+++ taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.h 2009-05-01 18:58:46.000000000 +0200
@@ -70,6 +70,7 @@
// Reimplementations.
virtual int length() const;
+ virtual int length_microseconds() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;