aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rw-r--r--3rdparty/utf8-cpp/checked.h (renamed from taglib/toolkit/utf8/checked.h)14
-rw-r--r--3rdparty/utf8-cpp/core.h (renamed from taglib/toolkit/utf8/core.h)3
-rw-r--r--INSTALL159
-rw-r--r--INSTALL.md175
-rw-r--r--NEWS3
-rw-r--r--taglib/CMakeLists.txt5
-rw-r--r--taglib/mp4/mp4tag.cpp4
-rw-r--r--taglib/toolkit/tstring.cpp9
-rw-r--r--tests/test_id3v2.cpp3
10 files changed, 202 insertions, 178 deletions
diff --git a/.travis.yml b/.travis.yml
index d724ae9d..88836480 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,8 @@ os:
- linux
- osx
+dist: trusty
+
compiler:
- gcc
- clang
@@ -24,5 +26,4 @@ matrix:
install:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install cppunit; fi
-script: cmake -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BINDINGS=ON . && make && make check
-
+script: cmake -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BINDINGS=ON -DCMAKE_CXX_FLAGS="-std=c++11" . && make && make check
diff --git a/taglib/toolkit/utf8/checked.h b/3rdparty/utf8-cpp/checked.h
index 13311551..2aef5838 100644
--- a/taglib/toolkit/utf8/checked.h
+++ b/3rdparty/utf8-cpp/checked.h
@@ -1,4 +1,4 @@
-// Copyright 2006 Nemanja Trifunovic
+// Copyright 2006-2016 Nemanja Trifunovic
/*
Permission is hereby granted, free of charge, to any person or organization
@@ -41,7 +41,7 @@ namespace utf8
class invalid_code_point : public exception {
uint32_t cp;
public:
- invalid_code_point(uint32_t cp) : cp(cp) {}
+ invalid_code_point(uint32_t codepoint) : cp(codepoint) {}
virtual const char* what() const throw() { return "Invalid code point"; }
uint32_t code_point() const {return cp;}
};
@@ -233,7 +233,7 @@ namespace utf8
template <typename u16bit_iterator, typename octet_iterator>
u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
{
- while (start != end) {
+ while (start < end) {
uint32_t cp = utf8::next(start, end);
if (cp > 0xffff) { //make a surrogate pair
*result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
@@ -257,7 +257,7 @@ namespace utf8
template <typename octet_iterator, typename u32bit_iterator>
u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
{
- while (start != end)
+ while (start < end)
(*result++) = utf8::next(start, end);
return result;
@@ -272,9 +272,9 @@ namespace utf8
public:
iterator () {}
explicit iterator (const octet_iterator& octet_it,
- const octet_iterator& range_start,
- const octet_iterator& range_end) :
- it(octet_it), range_start(range_start), range_end(range_end)
+ const octet_iterator& rangestart,
+ const octet_iterator& rangeend) :
+ it(octet_it), range_start(rangestart), range_end(rangeend)
{
if (it < range_start || it > range_end)
throw std::out_of_range("Invalid utf-8 iterator position");
diff --git a/taglib/toolkit/utf8/core.h b/3rdparty/utf8-cpp/core.h
index 693d388c..ae0f367d 100644
--- a/taglib/toolkit/utf8/core.h
+++ b/3rdparty/utf8-cpp/core.h
@@ -222,6 +222,9 @@ namespace internal
template <typename octet_iterator>
utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
+ if (it == end)
+ return NOT_ENOUGH_ROOM;
+
// Save the original value of it so we can go back in case of failure
// Of course, it does not make much sense with i.e. stream iterators
octet_iterator original_it = it;
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 0fb4862f..00000000
--- a/INSTALL
+++ /dev/null
@@ -1,159 +0,0 @@
-TagLib Installation
-===================
-
-TagLib uses the CMake build system. As a user, you will most likely want to
-build TagLib in release mode and install it into a system-wide location.
-This can be done using the following commands:
-
- cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .
- make
- sudo make install
-
-In order to build the included examples, use the BUILD_EXAMPLES option:
-
- cmake -DBUILD_EXAMPLES=ON [...]
-
-See http://www.cmake.org/cmake/help/runningcmake.html for generic help on
-running CMake.
-
-Mac OS X
---------
-
-On Mac OS X, you might want to build a framework that can be easily integrated
-into your application. If you set the BUILD_FRAMEWORK option on, it will compile
-TagLib as a framework. For example, the following command can be used to build
-an Universal Binary framework with Mac OS X 10.4 as the deployment target:
-
- cmake -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_FRAMEWORK=ON \
- -DCMAKE_C_COMPILER=/usr/bin/gcc-4.0 \
- -DCMAKE_CXX_COMPILER=/usr/bin/c++-4.0 \
- -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk/ \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 \
- -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64"
-
-For a 10.6 Snow Leopard static library with both 32-bit and 64-bit code, use:
-
- cmake -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \
- -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
- -DBUILD_SHARED_LIBS=OFF \
- -DCMAKE_INSTALL_PREFIX="<folder you want to build to>"
-
-After 'make', and 'make install', add libtag.a to your XCode project, and add
-the include folder to the project's User Header Search Paths.
-
-Windows
--------
-
-It's Windows ... Systems vary!
-This means you need to adjust things to suit your system, especially paths.
-
-Tested with:
- Microsoft Visual Studio 2010
- Gcc by mingw-w64.sf.net v4.6.3 (Strawberry Perl 32b)
- MinGW32-4.8.0
-
-Requirements:
- 1. Tool chain, Build Environment, Whatever ya want to call it ...
- Installed and working.
- 2. CMake program. (Available at: www.cmake.org)
- Installed and working.
-
-Optional:
- 1. Zlib library.
- Available in some Tool Chains, Not all.
- Search the web, Take your choice.
-
-Useful configuration options used with CMake (GUI and/or Command line):
- Any of the ZLIB_ variables may be used at the command line, ZLIB_ROOT is only
- available on the Command line.
- ZLIB_ROOT= Where to find ZLib's root directory.
- Assumes parent of: \include and \lib.
- ZLIB_INCLUDE_DIR= Where to find ZLib's Include directory.
- ZLIB_LIBRARY= Where to find ZLib's Library.
- ZLIB_SOURCE= Where to find ZLib's Source Code.
- Alternative to ZLIB_INCLUDE_DIR and ZLIB_LIBRARY.
- CMAKE_INSTALL_PREFIX= Where to install Taglib.
- CMAKE_BUILD_TYPE= Release, Debug, etc ... (Not available in MSVC)
-
-The easiest way is at the Command Prompt.
- MSVS Command Prompt for MSVS Users.
- (Batch file and/or Shortcuts are your friends)
-
- 1. Build the Makefiles:
- Replace "GENERATOR" with your needs.
- For MSVS : "Visual Studio X" where X is the single or two digit version.
- For MinGW: "MinGW Makefiles"
-
- C:\GitRoot\taglib> cmake -G "GENERATOR" -DCMAKE_INSTALL_PREFIX=C:\Libraries\taglib
-
- Or use the CMake GUI:
- 1. Open CMake GUI.
- 2. Set Paths.
- "Where is the source code" and "Where to build the binaries"
- Example, Both would be: C:\GitRoot\taglib
- 3. Tick: Advanced
- 4. Select: Configure
- 5. Select: Generator
- 6. Tick: Use default native compilers
- 7. Select: Finish
- Wait until done.
- 5. If using ZLib, Scroll down.
- (to the bottom of the list of options ... should go over them all)
- 1. Edit: ZLIB_INCLUDE_DIR
- 2. Edit: ZLIB_LIBRARY
- 6. Select: Generate
-
- 2. Build the project:
- MSVS:
- C:\GitRoot\taglib> msbuild all_build.vcxproj /p:Configuration=Release
- OR (Depending on MSVS version or personal choice)
- C:\GitRoot\taglib> devenv all_build.vcxproj /build Release
- MinGW:
- C:\GitRoot\taglib> gmake
- OR (Depending on MinGW install)
- C:\GitRoot\taglib> mingw32-make
-
- Or in the MSVS GUI:
- 1. Open MSVS.
- 2. Open taglib solution.
- 3. Set build type to: Release (look in the tool bars)
- 2. Hit F7 to build the solution. (project)
-
- 3. Install the project:
- (Change 'install' to 'uninstall' to uninstall the project)
- MSVS:
- C:\GitRoot\taglib> msbuild install.vcxproj
- OR (Depending on MSVC version or personal choice)
- C:\GitRoot\taglib> devenv install.vcxproj
- MinGW:
- C:\GitRoot\taglib> gmake install
- OR (Depending on MinGW install)
- C:\GitRoot\taglib> mingw32-make install
-
- Or in the MSVS GUI:
- 1. Open project.
- 2. Open Solution Explorer.
- 3. Right Click: INSTALL
- 4. Select: Project Only
- 5. Select: Build Only INSTALL
-
-To build a static library, set the following two options with CMake.
- -DBUILD_SHARED_LIBS=OFF -DENABLE_STATIC_RUNTIME=ON
-
-Including ENABLE_STATIC_RUNTIME=ON indicates you want TagLib built using the
-static runtime library, rather than the DLL form of the runtime.
-
-Unit Tests
-----------
-
-If you want to run the test suite to make sure TagLib works properly on your
-system, you need to have cppunit installed. To build the tests, include
-the option -DBUILD_TESTS=on when running cmake.
-
-The test suite has a custom target in the build system, so you can run
-the tests using make:
-
- make check
-
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 00000000..ee9a81ae
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,175 @@
+TagLib Installation
+===================
+
+TagLib uses the CMake build system. As a user, you will most likely want to
+build TagLib in release mode and install it into a system-wide location.
+This can be done using the following commands:
+
+ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .
+ make
+ sudo make install
+
+In order to build the included examples, use the `BUILD_EXAMPLES` option:
+
+ cmake -DBUILD_EXAMPLES=ON [...]
+
+See http://www.cmake.org/cmake/help/runningcmake.html for generic help on
+running CMake.
+
+Mac OS X
+--------
+
+On Mac OS X, you might want to build a framework that can be easily integrated
+into your application. If you set the BUILD_FRAMEWORK option on, it will compile
+TagLib as a framework. For example, the following command can be used to build
+an Universal Binary framework with Mac OS X 10.4 as the deployment target:
+
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_FRAMEWORK=ON \
+ -DCMAKE_C_COMPILER=/usr/bin/gcc-4.0 \
+ -DCMAKE_CXX_COMPILER=/usr/bin/c++-4.0 \
+ -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk/ \
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 \
+ -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64"
+
+For a 10.6 Snow Leopard static library with both 32-bit and 64-bit code, use:
+
+ cmake -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \
+ -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DCMAKE_INSTALL_PREFIX="<folder you want to build to>"
+
+After `make`, and `make install`, add `libtag.` to your XCode project, and add
+the include folder to the project's User Header Search Paths.
+
+Windows
+-------
+
+It's Windows ... Systems vary!
+This means you need to adjust things to suit your system, especially paths.
+
+Tested with:
+* Microsoft Visual Studio 2010, 2015, 2017
+* Microsoft C++ Build Tools 2015, 2017 (standalone packages not requiring Visual Studio)
+* Gcc by mingw-w64.sf.net v4.6.3 (Strawberry Perl 32b)
+* MinGW32-4.8.0
+
+Requirements:
+* Tool chain, build environment, whatever ya want to call it ...
+ Installed and working.
+* CMake program. (Available at: www.cmake.org)
+ Installed and working.
+
+Optional:
+* Zlib library.
+ Available in some tool chains, not all.
+ Search the web, take your choice.
+
+Useful configuration options used with CMake (GUI and/or command line):
+ Any of the `ZLIB_` variables may be used at the command line, `ZLIB_ROOT` is only
+ available on the command line.
+
+ | option | description |
+ ---------------------| ------------|
+ `ZLIB_ROOT=` | Where to find ZLib's root directory. Assumes parent of: `\include` and `\lib.`|
+ `ZLIB_INCLUDE_DIR=` | Where to find ZLib's Include directory.|
+ `ZLIB_LIBRARY=` | Where to find ZLib's Library.
+ `ZLIB_SOURCE=` | Where to find ZLib's Source Code. Alternative to `ZLIB_INCLUDE_DIR` and `ZLIB_LIBRARY`.
+ `CMAKE_INSTALL_PREFIX=` | Where to install Taglib. |
+ `CMAKE_BUILD_TYPE=` | Release, Debug, etc ... (Not available in MSVC) |
+
+The easiest way is at the command prompt (Visual C++ command prompt for MSVS users – batch file and/or shortcuts are your friends).
+
+1. **Build the Makefiles:**
+
+ Replace "GENERATOR" with your needs.
+ * For MSVS: `Visual Studio XX YYYY`, e.g. `Visual Studio 14 2015`.
+
+ **Note**: As Visual Studio 2017 supports CMake, you can skip this step and open the taglib
+ folder in VS instead.
+ * For MinGW: `MinGW Makefiles`
+
+ C:\GitRoot\taglib> cmake -G "GENERATOR" -DCMAKE_INSTALL_PREFIX=C:\Libraries\taglib
+
+ Or use the CMake GUI:
+ 1. Open CMake GUI.
+ 2. Set paths: *Where is the source code* and *Where to build the binaries*.
+
+ In the example, both would be: `C:\GitRoot\taglib`
+ 3. Tick: Advanced
+ 4. Select: Configure
+ 5. Select: Generator
+ 6. Tick: Use default native compilers
+ 7. Select: Finish
+ Wait until done.
+ 8. If using ZLib, Scroll down.
+ (to the bottom of the list of options ... should go over them all)
+ 1. Edit: `ZLIB_INCLUDE_DIR`
+ 2. Edit: `ZLIB_LIBRARY`
+ 9. Select: Generate
+
+2. **Build the project**
+ * MSVS:
+
+ C:\GitRoot\taglib> msbuild all_build.vcxproj /p:Configuration=Release
+ OR (Depending on MSVS version or personal choice)
+
+ C:\GitRoot\taglib> devenv all_build.vcxproj /build Release
+ OR in the MSVS GUI:
+ 1. Open MSVS.
+ 2. Open taglib solution.
+ 3. Set build type to: Release (look in the tool bars)
+ 2. Hit F7 to build the solution. (project)
+ * MinGW:
+
+ C:\GitRoot\taglib> gmake
+
+ OR (Depending on MinGW install)
+
+ C:\GitRoot\taglib> mingw32-make
+
+
+
+3. **Install the project**
+
+ (Change `install` to `uninstall` to uninstall the project)
+ * MSVS:
+
+ C:\GitRoot\taglib> msbuild install.vcxproj
+ OR (Depending on MSVC version or personal choice)
+
+ C:\GitRoot\taglib> devenv install.vcxproj
+
+ Or in the MSVS GUI:
+ 1. Open project.
+ 2. Open Solution Explorer.
+ 3. Right Click: INSTALL
+ 4. Select: Project Only
+ 5. Select: Build Only INSTALL
+ * MinGW:
+
+ C:\GitRoot\taglib> gmake install
+ OR (Depending on MinGW install)
+
+ C:\GitRoot\taglib> mingw32-make install
+
+
+To build a static library, set the following two options with CMake:
+
+ -DBUILD_SHARED_LIBS=OFF -DENABLE_STATIC_RUNTIME=ON
+
+Including `ENABLE_STATIC_RUNTIME=ON` indicates you want TagLib built using the
+static runtime library, rather than the DLL form of the runtime.
+
+Unit Tests
+----------
+
+If you want to run the test suite to make sure TagLib works properly on your
+system, you need to have cppunit installed. To build the tests, include
+the option `-DBUILD_TESTS=on` when running cmake.
+
+The test suite has a custom target in the build system, so you can run
+the tests using make:
+
+ make check
diff --git a/NEWS b/NEWS
index ac22cd93..67908264 100644
--- a/NEWS
+++ b/NEWS
@@ -4,9 +4,10 @@
* Added support for classical music tags of iTunes 12.5.
* Dropped support for Windows 9x and NT 4.0 or older.
* Fixed reading MP4 atoms with zero length.
+ * Fixed reading FLAC files with zero-sized seektables.
* Fixed handling of lowercase field names in Vorbis Comments.
+ * Fixed handling of 'rate' atoms in MP4 files.
* Fixed possible file corruptions when saving Ogg files.
- * Fixed reading FLAC files with zero-sized seektables.
* Better handling of invalid UTF-8 sequences.
* Several smaller bug fixes and performance improvements.
diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt
index 13ba7892..25041d25 100644
--- a/taglib/CMakeLists.txt
+++ b/taglib/CMakeLists.txt
@@ -24,6 +24,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/s3m
${CMAKE_CURRENT_SOURCE_DIR}/it
${CMAKE_CURRENT_SOURCE_DIR}/xm
+ ${CMAKE_SOURCE_DIR}/3rdparty
)
if(ZLIB_FOUND)
@@ -32,10 +33,6 @@ elseif(HAVE_ZLIB_SOURCE)
include_directories(${ZLIB_SOURCE})
endif()
-if(Boost_FOUND)
- include_directories(${Boost_INCLUDE_DIR})
-endif()
-
set(tag_HDRS
tag.h
fileref.h
diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp
index a7a473a2..11d3cc51 100644
--- a/taglib/mp4/mp4tag.cpp
+++ b/taglib/mp4/mp4tag.cpp
@@ -74,7 +74,7 @@ MP4::Tag::Tag(TagLib::File *file, MP4::Atoms *atoms) :
atom->name == "hdvd" || atom->name == "shwm") {
parseBool(atom);
}
- else if(atom->name == "tmpo" || atom->name == "\251mvi" || atom->name == "\251mvc") {
+ else if(atom->name == "tmpo" || atom->name == "rate" || atom->name == "\251mvi" || atom->name == "\251mvc") {
parseInt(atom);
}
else if(atom->name == "tvsn" || atom->name == "tves" || atom->name == "cnID" ||
@@ -476,7 +476,7 @@ MP4::Tag::save()
name == "shwm") {
data.append(renderBool(name.data(String::Latin1), it->second));
}
- else if(name == "tmpo" || name == "\251mvi" || name == "\251mvc") {
+ else if(name == "tmpo" || name == "rate" || name == "\251mvi" || name == "\251mvc") {
data.append(renderInt(name.data(String::Latin1), it->second));
}
else if(name == "tvsn" || name == "tves" || name == "cnID" ||
diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp
index 283a7f2b..c60a3e2e 100644
--- a/taglib/toolkit/tstring.cpp
+++ b/taglib/toolkit/tstring.cpp
@@ -26,11 +26,12 @@
#include <cerrno>
#include <climits>
+#include <utf8-cpp/checked.h>
+
#include <tdebug.h>
#include <tstringlist.h>
#include <trefcounter.h>
#include <tutils.h>
-#include <utf8/checked.h>
#include "tstring.h"
@@ -68,7 +69,8 @@ namespace
data.resize(dstEnd - data.begin());
}
catch(const utf8::exception &e) {
- debug(String("String::copyFromUTF8() - UTF8-CPP error: ") + e.what());
+ const String message(e.what());
+ debug("String::copyFromUTF8() - UTF8-CPP error: " + message);
data.clear();
}
}
@@ -435,7 +437,8 @@ ByteVector String::data(Type t) const
v.resize(static_cast<unsigned int>(dstEnd - v.begin()));
}
catch(const utf8::exception &e) {
- debug(String("String::data() - UTF8-CPP error: ") + e.what());
+ const String message(e.what());
+ debug("String::data() - UTF8-CPP error: " + message);
v.clear();
}
diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp
index 6cb604e0..7d94af06 100644
--- a/tests/test_id3v2.cpp
+++ b/tests/test_id3v2.cpp
@@ -961,6 +961,9 @@ public:
CPPUNIT_ASSERT(parsedFrameMvin);
CPPUNIT_ASSERT_EQUAL(String("Movement Name"), parsedFrameMvnm->toString());
CPPUNIT_ASSERT_EQUAL(String("2/3"), parsedFrameMvin->toString());
+
+ tag.addFrame(parsedFrameMvnm);
+ tag.addFrame(parsedFrameMvin);
}
void testDeleteFrame()