Hello community, here is the log from the commit of package taglib.1643 for openSUSE:12.3:Update checked in at 2013-05-14 16:28:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.3:Update/taglib.1643 (Old) and /work/SRC/openSUSE:12.3:Update/.taglib.1643.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "taglib.1643" Changes: -------- New Changes file: --- /dev/null 2013-05-09 10:40:33.472011256 +0200 +++ /work/SRC/openSUSE:12.3:Update/.taglib.1643.new/taglib.changes 2013-05-14 16:28:55.000000000 +0200 @@ -0,0 +1,425 @@ +------------------------------------------------------------------- +Fri Apr 26 17:19:29 UTC 2013 - [email protected] + +- Added taglib-1.8-ds-rusxmms-r8.patch which fixes bnc#814814 where + non russian text was corrupted in tags. +- Removed old taglib-1.8-ds-rusxmms-r2.patch +- Added built binary examples which manipulate tags from the + command line to enable easier testing of libtag. These are in the + taglib rpm. +- Created taglib-1.8-strip-rpath.patch to remove rpath from binaries. + +------------------------------------------------------------------- +Mon Feb 4 19:50:45 UTC 2013 - [email protected] + +- Replace taglib-1.6-ds-rusxmms.patch with + taglib-1.8-ds-rusxmms-r2.patch: Update rusxmms patch to also work + with non-Russian locale (bnc#780256). + +------------------------------------------------------------------- +Mon Feb 4 19:50:45 UTC 2013 - [email protected] + +- Update rusxmms patch to version taglib-1.8-ds-rusxmms-r2 in order to fix bnc#780256 + +------------------------------------------------------------------- +Fri Feb 1 18:54:07 UTC 2013 - [email protected] + +- update license to new format + +------------------------------------------------------------------- +Thu Nov 8 04:49:38 UTC 2012 - [email protected] + +- Add patch taglib-1.8-version_fix.patch: fix version defines + in taglib.h + +------------------------------------------------------------------- +Thu Sep 13 10:11:52 UTC 2012 - [email protected] + +- Update to 1.8 + * Added support for OWNE ID3 frames. + * Changed key validation in the new PropertyMap API. + * ID3v1::Tag::setStringHandler will no londer delete the previous handler, the caller is responsible for this. + * File objects will also no longer delete the passed IOStream objects. It should be done in the caller code after the File object is no longer used. + * Added ID3v2::Tag::setLatin1StringHandler for custom handling of latin1-encoded text in ID3v2 frames. + * Fixed validation of ID3v2 frame IDs (IDs with ‘0’ were ignored). + * New API for accessing tags by name. + * New abstract I/O stream layer to allow custom I/O handlers. + * Support for writing ID3v2.3 tags. + * Support for various module file formats (MOD, S3M, IT, XM). + * Support for MP4 and ASF is now enabled by default. + * Started using atomic int operations for reference counting. + * Added methods for checking if WMA and MP4 files are DRM-protected. + * Added taglib_free to the C bindings. + * New method to allow removing pictures from FLAC files. + * Support for reading audio properties from ALAC and Musepack SV8 files. + * Added replay-gain information to Musepack audio properties. + * Support for APEv2 binary tags. + * Many AudioProperties subclasses now provide information about the total number of samples. + * Various small bug fixes. +- Drop taglib-noansiflags.patch (no longer relevant) + +------------------------------------------------------------------- +Fri May 11 10:22:59 UTC 2012 - [email protected] + +-Update to 1.7.2: + * Fixed division by zero while parsing corrupted MP4 files (CVE-2012-2396). + * Fixed compilation on Haiku. + * Improved parsing of corrupted WMA, RIFF and OGG files. + * Fixed a memory leak in the WMA parser. + * Fixed a memory leak in the FLAC parser. + * Fixed a possible division by zero in the APE parser. + * Added detection of TTA2 files. + * Fixed saving of multiple identically named tags to Vorbis Comments. +-Fixed a build failure related to doxygen. + +------------------------------------------------------------------- +Thu May 10 01:51:54 UTC 2012 - [email protected] + +- Also, define GNU_SOURCE + +------------------------------------------------------------------- +Thu May 10 01:11:38 UTC 2012 - [email protected] + +- No dont use -ansi gcc flag. + +------------------------------------------------------------------- +Thu Mar 8 01:01:13 YEKT 2012 - [email protected] + +- Add rusxmms patch to be fixed https://features.opensuse.org/313273 + +------------------------------------------------------------------- +Sat May 28 07:03:00 UTC 2011 - [email protected] + +- Made taglib become a package again to satisfy the depencies of + packages that still require it. + +------------------------------------------------------------------- +Sat May 28 04:31:40 UTC 2011 - [email protected] + +- Conflict the last version of taglib that contained the libraries + from the library subpackages. +- Make sure the devel package obsoletes the last version of + taglib-devel where the main package contained the libraries. +- taglib is the name of the srcrpm, moved docs to devel subpackage. + +------------------------------------------------------------------- +Wed May 25 14:19:41 UTC 2011 - [email protected] + +- obsolete the right version of taglib + +------------------------------------------------------------------- +Sun May 22 22:29:07 UTC 2011 - [email protected] + +- make taglib become a package again, that has only one duty, to require + libtag1 and libtag_c0 for packages that still require taglib instead of + the new package names libtag1 and libtag_c0 + +------------------------------------------------------------------- +Tue May 17 20:55:51 UTC 2011 - [email protected] + +- Update to version 1.7: + * Fixed memory leaks in the FLAC file format parser. + * Fixed bitrate calculation for WAV files. + From 1.7 RC1 + * Support for reading/writing tags from Monkey's Audio files. (BUG:210404) + * Support for reading/writing embedded pictures from WMA files. + * Support for reading/writing embedded pictures from FLAC files (BUG:218696). + * Implemented APE::Tag::isEmpty() to check for all APE tags, not just the + basic ones. + * Added reading of WAV audio length. (BUG:116033) + * Exposed FLAC MD5 signature of the uncompressed audio stream via + FLAC::Properties::signature(). (BUG:160172) + * Added function ByteVector::toHex() for hex-encoding of byte vectors. + * WavPack reader now tries to get the audio length by finding the final + block, if the header doesn't have the information. (BUG:258016) + * Fixed a memory leak in the ID3v2.2 PIC frame parser. (BUG:257007) + * Fixed writing of RIFF files with even chunk sizes. (BUG:243954) + * Fixed compilation on MSVC 2010. + * Removed support for building using autoconf/automake. + * API docs can be now built using "make docs". +- Spec file updates: + * Changes based on openSUSE shared library packaging policy (added libtag1, + libtag_c0 and libtag-devel packages, removed taglib and taglib-devel + packages). + * Changes based on spec-cleaner run. + * Changed License: to LGPLv2.1+ ; MPLv1.1 .. + * Updates in Group, Summary and %description entries. + * Added libcppunit-devel and pkg-config in BuildRequires. + * Minor other updates. +- Updated taglib.desktop for susehelp to point to libtag-devel. + +------------------------------------------------------------------- +Sat Feb 26 14:24:48 UTC 2011 - [email protected] + +- update to version 1.6.3 + * Fixed definitions of the TAGLIB_WITH_MP4 and TAGLIB_WITH_ASF macros. + * Fixed upgrading of ID3v2.3 genre frame with ID3v1 code 0 (Blues). + * New method `int String::toInt(bool *ok)` which can return whether the conversion to a number was successful. + * Fixed parsing of incorrectly written lengths in ID3v2 (affects mainly compressed frames). + + +------------------------------------------------------------------- +Sun Apr 11 17:07:36 UTC 2010 - [email protected] + +- update to version 1.6.2 + * Read Vorbis Comments from the first FLAC metadata block, + if there are multipe ones. + * Fixed a memory leak in FileRef's OGA format detection. + * Fixed compilation with the Sun Studio compiler. + * Handle WM/TrackNumber attributes with DWORD content in WMA files. + * More strict check if something is a valid MP4 file. + * Correctly save MP4 int-pair atoms with flags set to 0. + * Fixed compilation of the test runner on Windows. + * Store ASF attributes larger than 64k in the metadata library object. + * Ignore trailing non-data atoms when parsing MP4 covr atoms. + * Don't upgrade ID3v2.2 frame TDA to TDRC. + +------------------------------------------------------------------- +Mon Feb 1 12:33:03 UTC 2010 - [email protected] + +- Package baselibs.conf + +------------------------------------------------------------------- +Tue Nov 3 23:21:25 UTC 2009 - [email protected] + +- Update to version 1.6.1 + * Better detection of the audio codec of .oga files in FileRef. + * Fixed saving of Vorbis comments to Ogg FLAC files. TagLib tried to + include the Vorbis framing bit, which is only correct for Ogg Vorbis. + * Public symbols now have explicitly set visibility to "default" on GCC. + * Added missing exports for static ID3v1 functions. + * Fixed a typo in taglib_c.pc + * Fixed a failing test on ppc64. + * Support for binary 'covr' atom in MP4 files. TagLib 1.6 treated them + as text atoms, which corrupted them in some cases. + * Fixed ID3v1-style genre to string conversion in MP4 files. + +------------------------------------------------------------------- ++++ 228 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:12.3:Update/.taglib.1643.new/taglib.changes New: ---- baselibs.conf taglib-1.7.2-doxygen.patch taglib-1.8-ds-rusxmms-r8.patch taglib-1.8-strip-rpath.patch taglib-1.8-version_fix.patch taglib-1.8.tar.gz taglib.changes taglib.desktop taglib.spec ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ taglib.spec ++++++ # # spec file for package taglib # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: taglib Version: 1.8 Release: 0 Summary: Audio Meta-Data Library License: LGPL-2.1+ and MPL-1.1 Group: Productivity/Multimedia/Other Url: http://ktown.kde.org/~wheeler/taglib/ Source0: https://github.com/downloads/taglib/taglib/%{name}-%{version}.tar.gz Source1: %{name}.desktop Source100: baselibs.conf # This patch is to fix bnc#814814 and enables russian users to display Cryllics text correctly. Patch0: taglib-1.8-ds-rusxmms-r8.patch Patch1: taglib-1.7.2-doxygen.patch # PATCH-FIX-UPSTREAM taglib-1.8-version_fix.patch - fix version defines in taglib.h Patch2: taglib-1.8-version_fix.patch # Get example executables to build without rpath Patch3: taglib-1.8-strip-rpath.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake BuildRequires: doxygen BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: graphviz-gnome BuildRequires: libcppunit-devel BuildRequires: pkg-config %if 0%{?suse_version} BuildRequires: update-desktop-files %endif BuildRequires: librcc-devel BuildRequires: zlib-devel # NOTE: The tagreader and writer executables give different results when built with # an earlier taglib-1.8-ds-rusxmms patch. See bnc#814814 Requires: libtag1 = %{version}-%{release} Requires: libtag_c0 = %{version}-%{release} %description TagLib is a library for reading and editing the meta-data of several popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files. This package contains built examples which manipulate tags from the command line. %package -n libtag1 Summary: Audio Meta-Data Library License: LGPL-2.1+ Group: System/Libraries # Without this the old taglib package containing the libraries isn't removed when this package is installed. # The only alternative is for the libraries to Require: taglib version-release, badness 440 Conflicts: taglib <= 1.6.3 %description -n libtag1 TagLib is a library for reading and editing the meta-data of several popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files. %package -n libtag_c0 Summary: Audio Meta-Data Library License: LGPL-2.1+ Group: System/Libraries # Without this the old taglib package containing the libraries isn't removed when this package is installed. # The only alternative is for the libraries to Require: taglib version-release, badness 440 Conflicts: taglib <= 1.6.3 %description -n libtag_c0 TagLib is a library for reading and editing the meta-data of several popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files. %package -n libtag-devel Summary: Development files for taglib License: LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: libstdc++-devel Requires: libtag1 = %{version}-%{release} Requires: libtag_c0 = %{version}-%{release} # taglib-devel was last used in openSUSE 11.4 (taglib-devel-1.6.2) # The last taglib-devel used was version 1.6.3 from multimedia:libs. Provides: taglib-devel = %{version} Obsoletes: taglib-devel <= 1.6.3 %description -n libtag-devel This package contains development files for taglib. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 %build mkdir build cd build export CXXFLAGS="%{optflags} -D_GNU_SOURCE" export CFLAGS="%{optflags} -D_GNU_SOURCE" _libsuffix=$(echo %{_lib} | cut -b4-) cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DBUILD_TESTS:BOOL=ON \ -DLIB_SUFFIX=$_libsuffix \ -DWITH_ASF:BOOL=ON \ -DWITH_MP4:BOOL=ON \ -DBUILD_EXAMPLES:BOOL=ON .. make %{?_smp_mflags} VERBOSE=1 cd .. doxygen -u doxygen %install pushd build make DESTDIR=%{buildroot} install popd # install susehelp file mkdir -p %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/ install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/ %if 0%{?suse_version} %suse_update_desktop_file %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/%{name}.desktop %endif # Documentation mkdir -p %{buildroot}%{_defaultdocdir}/libtag-devel rm -f examples/CMake* cp -a AUTHORS COPYING.LGPL COPYING.MPL NEWS doc/html/ examples/ %{buildroot}%{_defaultdocdir}/libtag-devel/ %fdupes -s %{buildroot} # Add built examples to taglib package. mkdir -p %{buildroot}%{_bindir} for i in `find build/examples -maxdepth 1 ! -type d -executable`; do cp -v ${i} %{buildroot}%{_bindir}/; done %check # check the library #pushd tests #make check #popd %clean %{?buildroot:%__rm -rf "%{buildroot}"} %post -n libtag1 -p /sbin/ldconfig %postun -n libtag1 -p /sbin/ldconfig %post -n libtag_c0 -p /sbin/ldconfig %postun -n libtag_c0 -p /sbin/ldconfig %files -n libtag1 %defattr(-,root,root,-) %{_libdir}/libtag.so.1 %{_libdir}/libtag.so.1.* %files -n libtag_c0 %defattr(-,root,root,-) %{_libdir}/libtag_c.so.0 %{_libdir}/libtag_c.so.0.* %files -n libtag-devel %defattr(-,root,root,-) %doc %{_defaultdocdir}/libtag-devel %{_bindir}/taglib-config %{_includedir}/taglib/ %{_libdir}/libtag*.so %{_libdir}/pkgconfig/*.pc %{_datadir}/susehelp/ %files %defattr(-,root,root,-) %{_bindir}/* %exclude %{_bindir}/taglib-config %changelog ++++++ baselibs.conf ++++++ libtag1 libtag_c0 ++++++ taglib-1.7.2-doxygen.patch ++++++ diff --git a/CMakeLists.txt b/CMakeLists.txt index 20a1141..0e9e884 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,7 @@ if(BUILD_TESTS) endif(BUILD_TESTS) add_subdirectory(examples) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile) file(COPY doc/taglib.png DESTINATION doc) add_custom_target(docs doxygen) ++++++ taglib-1.8-ds-rusxmms-r8.patch ++++++ diff -dPNur taglib-1.8/config-taglib.h.cmake taglib-1.8-ds/config-taglib.h.cmake --- taglib-1.8/config-taglib.h.cmake 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/config-taglib.h.cmake 2013-04-24 17:44:12.000000000 +0200 @@ -3,6 +3,8 @@ /* Define if you have libz */ #cmakedefine HAVE_ZLIB 1 +#cmakedefine HAVE_LIBRCC 1 + #cmakedefine NO_ITUNES_HACKS 1 #cmakedefine WITH_ASF 1 #cmakedefine WITH_MP4 1 diff -dPNur taglib-1.8/ConfigureChecks.cmake taglib-1.8-ds/ConfigureChecks.cmake --- taglib-1.8/ConfigureChecks.cmake 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/ConfigureChecks.cmake 2013-04-24 17:44:12.000000000 +0200 @@ -14,6 +14,8 @@ set(HAVE_ZLIB 0) endif() +SET(HAVE_LIBRCC 1) + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) find_package(CppUnit) if(NOT CppUnit_FOUND AND BUILD_TESTS) diff -dPNur taglib-1.8/examples/tagreader_c.c taglib-1.8-ds/examples/tagreader_c.c --- taglib-1.8/examples/tagreader_c.c 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/examples/tagreader_c.c 2013-04-24 19:10:37.000000000 +0200 @@ -38,7 +38,7 @@ TagLib_Tag *tag; const TagLib_AudioProperties *properties; - taglib_set_strings_unicode(FALSE); +// taglib_set_strings_unicode(FALSE); for(i = 1; i < argc; i++) { printf("******************** \"%s\" ********************\n", argv[i]); diff -dPNur taglib-1.8/examples/tagwriter.cpp taglib-1.8-ds/examples/tagwriter.cpp --- taglib-1.8/examples/tagwriter.cpp 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/examples/tagwriter.cpp 2013-04-25 23:48:17.000000000 +0200 @@ -92,7 +92,7 @@ if(isArgument(argv[i]) && i + 1 < argc && !isArgument(argv[i + 1])) { char field = argv[i][1]; - TagLib::String value = argv[i + 1]; + TagLib::String value(argv[i + 1], TagLib::String::Locale); TagLib::List<TagLib::FileRef>::Iterator it; for(it = fileList.begin(); it != fileList.end(); ++it) { diff -dPNur taglib-1.8/taglib/CMakeLists.txt taglib-1.8-ds/taglib/CMakeLists.txt --- taglib-1.8/taglib/CMakeLists.txt 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/taglib/CMakeLists.txt 2013-04-24 17:44:12.000000000 +0200 @@ -35,6 +35,7 @@ audioproperties.h taglib_export.h ${CMAKE_BINARY_DIR}/taglib_config.h + toolkit/rccpatch.h toolkit/taglib.h toolkit/tstring.h toolkit/tlist.h @@ -269,6 +270,7 @@ ) set(toolkit_SRCS + toolkit/rccpatch.cpp toolkit/tstring.cpp toolkit/tstringlist.cpp toolkit/tbytevector.cpp @@ -296,7 +298,7 @@ add_library(tag ${tag_LIB_SRCS} ${tag_HDRS}) if(ZLIB_FOUND) - target_link_libraries(tag ${ZLIB_LIBRARIES}) + target_link_libraries(tag rcc ${ZLIB_LIBRARIES}) endif() set_target_properties(tag PROPERTIES diff -dPNur taglib-1.8/taglib/mpeg/id3v1/id3v1tag.cpp taglib-1.8-ds/taglib/mpeg/id3v1/id3v1tag.cpp --- taglib-1.8/taglib/mpeg/id3v1/id3v1tag.cpp 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/taglib/mpeg/id3v1/id3v1tag.cpp 2013-04-24 17:44:12.000000000 +0200 @@ -64,17 +64,18 @@ String ID3v1::StringHandler::parse(const ByteVector &data) const { - return String(data, String::Latin1).stripWhiteSpace(); + return String(data, String::Latin1ID3).stripWhiteSpace(); } ByteVector ID3v1::StringHandler::render(const String &s) const { if(!s.isLatin1()) { + if (String::ID3WType(String::Latin1) == String::Latin1) return ByteVector(); } - return s.data(String::Latin1); + return s.data(String::Latin1ID3); } //////////////////////////////////////////////////////////////////////////////// @@ -247,7 +248,7 @@ d->track = uchar(data[offset + 29]); } else - d->comment = data.mid(offset, 30); + d->comment = TagPrivate::stringHandler->parse(data.mid(offset, 30)); offset += 30; diff -dPNur taglib-1.8/taglib/mpeg/id3v2/frames/commentsframe.cpp taglib-1.8-ds/taglib/mpeg/id3v2/frames/commentsframe.cpp --- taglib-1.8/taglib/mpeg/id3v2/frames/commentsframe.cpp 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/taglib/mpeg/id3v2/frames/commentsframe.cpp 2013-04-24 17:44:12.000000000 +0200 @@ -150,10 +150,10 @@ return; } - d->textEncoding = String::Type(data[0]); + d->textEncoding = String::ID3Type(data[0]); d->language = data.mid(1, 3); - int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2; + int byteAlign = (d->textEncoding == String::Latin1 || d->textEncoding == String::Latin1ID3 || d->textEncoding == String::Latin1ID3V2 || d->textEncoding == String::UTF8) ? 1 : 2; ByteVectorList l = ByteVectorList::split(data.mid(4), textDelimiter(d->textEncoding), byteAlign, 2); @@ -174,10 +174,12 @@ String::Type encoding = d->textEncoding; + encoding = String::ID3WType(encoding); + encoding = checkTextEncoding(d->description, encoding); encoding = checkTextEncoding(d->text, encoding); - - v.append(char(encoding)); + + v.append(char(String::ID3RealType(encoding))); v.append(d->language.size() == 3 ? d->language : "XXX"); v.append(d->description.data(encoding)); v.append(textDelimiter(encoding)); diff -dPNur taglib-1.8/taglib/mpeg/id3v2/frames/textidentificationframe.cpp taglib-1.8-ds/taglib/mpeg/id3v2/frames/textidentificationframe.cpp --- taglib-1.8/taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2013-04-24 17:44:12.000000000 +0200 @@ -187,12 +187,12 @@ // read the string data type (the first byte of the field data) - d->textEncoding = String::Type(data[0]); + d->textEncoding = String::ID3Type(data[0]); // split the byte array into chunks based on the string type (two byte delimiter // for unicode encodings) - int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2; + int byteAlign = (d->textEncoding == String::Latin1 || d->textEncoding == String::Latin1ID3 || d->textEncoding == String::Latin1ID3V2 || d->textEncoding == String::UTF8) ? 1 : 2; // build a small counter to strip nulls off the end of the field @@ -223,11 +223,14 @@ ByteVector TextIdentificationFrame::renderFields() const { - String::Type encoding = checkTextEncoding(d->fieldList, d->textEncoding); + String::Type encoding = d->textEncoding; + + encoding = String::ID3WType(encoding); + encoding = checkTextEncoding(d->fieldList, encoding); ByteVector v; - v.append(char(encoding)); + v.append(char(String::ID3RealType(encoding))); for(StringList::ConstIterator it = d->fieldList.begin(); it != d->fieldList.end(); it++) { diff -dPNur taglib-1.8/taglib/toolkit/rccpatch.cpp taglib-1.8-ds/taglib/toolkit/rccpatch.cpp --- taglib-1.8/taglib/toolkit/rccpatch.cpp 1970-01-01 01:00:00.000000000 +0100 +++ taglib-1.8-ds/taglib/toolkit/rccpatch.cpp 2013-04-26 06:40:40.000000000 +0200 @@ -0,0 +1,237 @@ +#include <stdlib.h> + +#include <string> +#include "tstring.h" +#include "tbytevector.h" + +//#define RCC_DEBUG + + +#ifndef HAVE_LIBRCC +# include <config.h> +#endif + +#ifdef HAVE_LIBRCC +# ifdef RCC_DEBUG +# include <stdio.h> +# endif /* RCC_DEBUG */ +# include <librcc.h> +# include <string.h> +#endif /* HAVE_LIBRCC */ + + +#ifdef HAVE_LIBRCC +# define ID3_CLASS 0 +# define ID3V2_CLASS 1 +# define UTF_CLASS 2 +# define OUT_CLASS 3 +static rcc_class classes[] = { + { "id3", RCC_CLASS_STANDARD, NULL, NULL, "ID3 Encoding", 0 }, + { "id3v2", RCC_CLASS_STANDARD, "id3", NULL, "ID3 v.2 Encoding", 0 }, + { "utf", RCC_CLASS_KNOWN, "UTF-8", NULL, "Unicode Encoding", 0}, + { "out", RCC_CLASS_TRANSLATE_LOCALE, "LC_CTYPE", NULL, "Output Encoding", 0 }, + { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 } +}; + +static int rcc_initialized = 0; + +static rcc_context ctx = NULL; +#endif /* HAVE_LIBRCC */ + + +void rccTaglibPatchFree() { +#ifdef HAVE_LIBRCC + if (rcc_initialized) { + rccFree(); + rcc_initialized = 0; + } +#endif /* HAVE_LIBRCC */ +} + +void rccTaglibPatchInit() { +#ifdef HAVE_LIBRCC + if (rcc_initialized) return; + rccInit(); + rccInitDefaultContext(NULL, 0, 0, classes, 0); + rccLoad(NULL, "xmms"); + rccInitDb4(NULL, NULL, 0); + rcc_initialized = 1; +#endif /* HAVE_LIBRCC */ +} + +void rccTaglibPatchSetContext(void *newctx) { +#ifdef HAVE_LIBRCC + if (newctx) { + ctx = (rcc_context)newctx; + rcc_initialized = 1; + } +#endif /* HAVE_LIBRCC */ +} + +static void rccTaglibPatchTryInit() { +#ifdef HAVE_LIBRCC + if (!rcc_initialized) { + rccTaglibPatchInit(); + if (rcc_initialized) atexit(rccTaglibPatchFree); + } +#endif /* HAVE_LIBRCC */ +} + + +TagLib::ByteVector rccTaglibPatchRecodeOutput(const std::string &s) { + TagLib::ByteVector v; +#ifdef HAVE_LIBRCC + size_t rlen; + char *res; + + rccTaglibPatchTryInit(); + + res = rccSizedRecode(ctx, UTF_CLASS, OUT_CLASS, s.c_str(), s.length(), &rlen); +#ifdef RCC_DEBUG + for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) { + if (*c > 127) { + printf(" Output: %s - %s\n", s.c_str(), res?res:"null"); + break; + } + } +#endif /* RCC_DEBUG */ + + if (res) v.setData(res, rlen); + else v.setData("", 0); + //v.setData(s.c_str(), s.length()); + + return v; +#else + v.setData("", 0); + + return v; +#endif /* HAVE_LIBRCC */ +} + +TagLib::ByteVector rccTaglibPatchRecodeOutputID3(const std::string &s, bool v2 = false) { + TagLib::ByteVector v; +#ifdef HAVE_LIBRCC + size_t rlen; + char *res; + + rccTaglibPatchTryInit(); + + res = rccSizedRecode(ctx, UTF_CLASS, v2?ID3V2_CLASS:ID3_CLASS, s.c_str(), s.length(), &rlen); +#ifdef RCC_DEBUG + for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) { + if (*c > 127) { + printf(" OutputID3(%i): %s - %s\n", v2, s.c_str(), res?res:"null"); + break; + } + } +#endif /* RCC_DEBUG */ + + if (res) v.setData(res, rlen); + else v.setData("", 0); + //v.setData(s.c_str(), s.length()); + + return v; +#else + v.setData("", 0); + + return v; +#endif /* HAVE_LIBRCC */ +} + +TagLib::ByteVector rccTaglibPatchRecodeInput(const std::string &s) { + TagLib::ByteVector v; +#ifdef HAVE_LIBRCC + size_t rlen; + char *res; + + rccTaglibPatchTryInit(); + + res = rccSizedRecode(ctx, OUT_CLASS, UTF_CLASS, s.c_str(), s.length(), &rlen); +#ifdef RCC_DEBUG + for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) { + if (*c > 127) { + printf(" Input: %s - %s\n", s.c_str(), res?res:"null"); + break; + } + } +#endif /* RCC_DEBUG */ + + if (res) v.setData(res, rlen); + else +#endif /* HAVE_LIBRCC */ + v.setData("", 0); + + return v; +} + +TagLib::ByteVector rccTaglibPatchRecodeInputID3(const std::string &s, bool v2 = false) { + TagLib::ByteVector v; +#ifdef HAVE_LIBRCC + size_t rlen; + char *res; + + rccTaglibPatchTryInit(); + + res = rccSizedRecode(ctx, v2?ID3V2_CLASS:ID3_CLASS, UTF_CLASS, s.c_str(), s.length(), &rlen); +#ifdef RCC_DEBUG + for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) { + if (*c > 127) { + printf(" InputID3(%i): %s - %s\n", v2, s.c_str(), res?res:"null"); + break; + } + } +#endif /* RCC_DEBUG */ + if (res) v.setData(res, rlen); + else +#endif /* HAVE_LIBRCC */ + v.setData("", 0); + + return v; +} + +TagLib::String::Type rccTaglibPatchGetLocaleType() { +#ifdef HAVE_LIBRCC + size_t len; + char charset[32]; + + rccTaglibPatchTryInit(); + if (!rccLocaleGetCharset(charset, NULL, 31)) { + if (!strncmp(charset, "UTF", 3)) { + len = strlen(charset); + + if (charset[len-1]=='8') return TagLib::String::UTF8; + if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16; + if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE; + if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE; + } + return TagLib::String::Latin1; + } +#endif /* HAVE_LIBRCC */ + return TagLib::String::UTF8; +} + +TagLib::String::Type rccTaglibPatchGetID3Type() { +#ifdef HAVE_LIBRCC + size_t len; + const char *charset; + + rccTaglibPatchTryInit(); + + charset = rccGetCurrentCharsetName(ctx, ID3V2_CLASS); + if (charset) { + if (!strncmp(charset, "UTF", 3)) { + len = strlen(charset); + + if (charset[len-1]=='8') return TagLib::String::UTF8; + if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16; + if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE; + if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE; + } + return TagLib::String::Latin1ID3V2; + } else { + // Error or no-language configured: If Latin1ID3V2 is returned we normally will use the default unicode encoding unless Latin1 is selected by taglib + return TagLib::String::Latin1ID3V2; + } +#endif /* HAVE_LIBRCC */ + return TagLib::String::Latin1; +} diff -dPNur taglib-1.8/taglib/toolkit/rccpatch.h taglib-1.8-ds/taglib/toolkit/rccpatch.h --- taglib-1.8/taglib/toolkit/rccpatch.h 1970-01-01 01:00:00.000000000 +0100 +++ taglib-1.8-ds/taglib/toolkit/rccpatch.h 2013-04-24 17:44:12.000000000 +0200 @@ -0,0 +1,20 @@ +#ifndef _RCC_PATCH_H +#define _RCC_PATCH_H + +#include <string.h> +#include "tstring.h" +#include "tbytevector.h" + +void rccTaglibPatchFree(); +void rccTaglibPatchInit(); +void rccTaglibPatchSetContext(void *newctx); + +TagLib::ByteVector rccTaglibPatchRecodeOutput(const std::string &s); +TagLib::ByteVector rccTaglibPatchRecodeInput(const std::string &s); +TagLib::ByteVector rccTaglibPatchRecodeOutputID3(const std::string &s, bool v2 = false); +TagLib::ByteVector rccTaglibPatchRecodeInputID3(const std::string &s, bool v2 = false); + +TagLib::String::Type rccTaglibPatchGetLocaleType(); +TagLib::String::Type rccTaglibPatchGetID3Type(); + +#endif /* _RCC_PATCH_H */ diff -dPNur taglib-1.8/taglib/toolkit/tstring.cpp taglib-1.8-ds/taglib/toolkit/tstring.cpp --- taglib-1.8/taglib/toolkit/tstring.cpp 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/taglib/toolkit/tstring.cpp 2013-04-26 07:11:38.000000000 +0200 @@ -23,6 +23,7 @@ * http://www.mozilla.org/MPL/ * ***************************************************************************/ +#include "rccpatch.h" #include "tstring.h" #include "unicode.h" #include "tdebug.h" @@ -168,7 +169,7 @@ if(v.isEmpty()) return; - if(t == Latin1 || t == UTF8) { + if(t == Latin1 || t == Latin1ID3 || t == Latin1ID3V2 || t == UTF8) { int length = 0; d->data.resize(v.size()); @@ -397,10 +398,38 @@ { ByteVector v; - switch(t) { + if (t == Locale) { + // The source is either Unicode or real Latin1 (if rcc is bypassed) + std::string s = to8Bit(true); + + // In case of UTF8 locale, this probably will return NULL (no recoding needed), but we will take UTF8 path in the next swtich + v = rccTaglibPatchRecodeOutput(s); + if (v.size()) return v; + t = rccTaglibPatchGetLocaleType(); + } + + switch(t) { + case Latin1ID3: + case Latin1ID3V2: + { + std::string s = to8Bit(true); + if (t == Latin1ID3) v = rccTaglibPatchRecodeOutputID3(s, false); + else if (t == Latin1ID3V2) v = rccTaglibPatchRecodeOutputID3(s, true); + if (v.size()) break; + + // we don't know if we got NULL because rcc is disabled (error) or UTF8 output is required + if ((t == Latin1ID3V2)&&(rccTaglibPatchGetID3Type() == UTF8)) { + v.setData(s.c_str(), s.length()); + } else { + for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) + v.append(char(*it)); + } + break; + } case Latin1: { + // We can have the UTF16 inside, but first 256 positions is equal to Latin1 for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) v.append(char(*it)); break; @@ -750,6 +779,34 @@ void String::prepare(Type t) { + if (t == Locale) t = rccTaglibPatchGetLocaleType(); + + if ((t == Latin1)||(t == Latin1ID3)||(t == Latin1ID3V2)) { + std::string s = to8Bit(false); + ByteVector v; + + if (t == Latin1ID3) v = rccTaglibPatchRecodeInputID3(s, false); + else if (t == Latin1ID3V2) v = rccTaglibPatchRecodeInputID3(s, true); + else /* Latin1 converted from Locale */ v = rccTaglibPatchRecodeInput(s); + + if (v.size()) { + int length = 0; + d->data.resize(v.size()); + wstring::iterator targetIt = d->data.begin(); + for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) { + *targetIt = uchar(*it); + ++targetIt; + ++length; + } + d->data.resize(length); + t = UTF8; + } else { + // We don't know if we got UTF-8 encoded string or either rcc is disable or something is failed, + // since standard applications are really expecting here Latin1, it is safe to just check if we have violations of UTF8 + //if (Unicode::isLegalUTF8(s)) t = UTF8; + } + } + switch(t) { case UTF16: { @@ -839,6 +896,27 @@ std::ostream &operator<<(std::ostream &s, const String &str) { - s << str.to8Bit(); + ByteVector bv = str.data(String::Locale); + s << bv; return s; } + +String::Type String::ID3Type(int i) { + if (i == Latin1) return Latin1ID3V2; + return Type(i); +}; + +String::Type String::ID3WType(Type type) { + Type rcc_type = rccTaglibPatchGetID3Type(); + if ((rcc_type == Latin1ID3)||(rcc_type == Latin1ID3V2)||(rcc_type == Latin1)) { + if (type == Latin1) return rcc_type; + return type; + } + + return rcc_type; +}; + +String::Type String::ID3RealType(Type type) { + if ((type == Latin1ID3)||(type == Latin1ID3V2)) return Latin1; + return type; +} diff -dPNur taglib-1.8/taglib/toolkit/tstring.h taglib-1.8-ds/taglib/toolkit/tstring.h --- taglib-1.8/taglib/toolkit/tstring.h 2012-09-06 20:03:15.000000000 +0200 +++ taglib-1.8-ds/taglib/toolkit/tstring.h 2013-04-24 17:44:12.000000000 +0200 @@ -90,6 +90,18 @@ */ enum Type { /*! + * Determine using current locale settings + */ + Locale = -1, + /*! + * Latin1 for ID3 tags. + */ + Latin1ID3 = 65, + /*! + * Latin1 for ID3 tags. + */ + Latin1ID3V2 = 66, + /*! * IS08859-1, or <i>Latin1</i> encoding. 8 bit characters. */ Latin1 = 0, @@ -112,6 +124,10 @@ UTF16LE = 4 }; + static Type ID3Type(int i); + static Type ID3WType(Type type); + static Type ID3RealType(Type type); + /*! * Constructs an empty String. */ ++++++ taglib-1.8-strip-rpath.patch ++++++ Index: examples/CMakeLists.txt =================================================================== --- examples/CMakeLists.txt.orig 2012-09-06 20:03:15.000000000 +0200 +++ examples/CMakeLists.txt 2013-04-23 08:44:33.938480393 +0200 @@ -11,6 +11,8 @@ if(ENABLE_STATIC) add_definitions(-DTAGLIB_STATIC) endif(ENABLE_STATIC) +SET(CMAKE_SKIP_BUILD_RPATH TRUE) + ########### next target ############### ADD_EXECUTABLE(tagreader tagreader.cpp) @@ -45,6 +47,14 @@ ADD_EXECUTABLE(strip-id3v1 strip-id3v1.c TARGET_LINK_LIBRARIES(strip-id3v1 tag ) +#set_target_properties(examples PROPERTIES +# INSTALL_NAME_DIR ${BIN_INSTALL_DIR} +# LINK_INTERFACE_LIBRARIES "" +#) + +#install(TARGETS examples +# FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR} +# RUNTIME DESTINATION ${BIN_INSTALL_DIR} +#) endif(BUILD_EXAMPLES) - ++++++ taglib-1.8-version_fix.patch ++++++ diff -ur taglib-1.8/taglib/toolkit/taglib.h taglib-1.8.nu/taglib/toolkit/taglib.h --- taglib-1.8/taglib/toolkit/taglib.h 2012-09-06 15:03:15.000000000 -0300 +++ taglib-1.8.nu/taglib/toolkit/taglib.h 2012-11-08 01:47:51.088000009 -0300 @@ -27,7 +27,7 @@ #define TAGLIB_H #define TAGLIB_MAJOR_VERSION 1 -#define TAGLIB_MINOR_VERSION 7 +#define TAGLIB_MINOR_VERSION 8 #define TAGLIB_PATCH_VERSION 0 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) ++++++ taglib.desktop ++++++ [Desktop Entry] Name=Taglib API reference Name[de]=Taglib API Referenz Name[hu]=Taglib API referencia DocPath=/usr/share/doc/packages/libtag-devel/html/index.html X-DOC-SearchMethod=htdig -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
