From bc106ad81e1015c896b32ae1fec6cb3c3894ac84 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Mon, 10 Aug 2015 00:50:13 +0900 Subject: [PATCH 1/9] Separate two variable initializations. --- taglib/mpeg/id3v2/frames/chapterframe.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/taglib/mpeg/id3v2/frames/chapterframe.cpp b/taglib/mpeg/id3v2/frames/chapterframe.cpp index a424cb3c..ad471ecd 100644 --- a/taglib/mpeg/id3v2/frames/chapterframe.cpp +++ b/taglib/mpeg/id3v2/frames/chapterframe.cpp @@ -245,7 +245,8 @@ void ChapterFrame::parseFields(const ByteVector &data) return; } - int pos = 0, embPos = 0; + int pos = 0; + TagLib::uint embPos = 0; d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1); d->startTime = data.toUInt(pos, true); pos += 4; @@ -262,7 +263,7 @@ void ChapterFrame::parseFields(const ByteVector &data) if(size < header()->size()) return; - while((uint)embPos < size - header()->size()) { + while(embPos < size - header()->size()) { Frame *frame = FrameFactory::instance()->createFrame(data.mid(pos + embPos), (d->tagHeader != 0)); if(!frame) From d90617959b707061bea24df13147b427fcaeaf18 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Tue, 11 Aug 2015 09:45:32 +0900 Subject: [PATCH 2/9] Fix some typos in comments. --- taglib/riff/wav/infotag.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/taglib/riff/wav/infotag.h b/taglib/riff/wav/infotag.h index 2f6930c0..c99b59ac 100644 --- a/taglib/riff/wav/infotag.h +++ b/taglib/riff/wav/infotag.h @@ -37,7 +37,7 @@ namespace TagLib { class File; - //! A RIFF Info tag implementation. + //! A RIFF INFO tag implementation. namespace RIFF { namespace Info { @@ -46,11 +46,11 @@ namespace TagLib { //! A abstraction for the string to data encoding in Info tags. /*! - * RIFF Info tag has no clear definitions about character encodings. + * RIFF INFO tag has no clear definitions about character encodings. * In practice, local encoding of each system is largely used and UTF-8 is * popular too. * - * Here is an option to read and write tags in your preferrd encoding + * Here is an option to read and write tags in your preferred encoding * by subclassing this class, reimplementing parse() and render() and setting * your reimplementation as the default with Info::Tag::setStringHandler(). * From bd564546f48c057c01520113530d11348425567d Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 14 Aug 2015 00:10:19 +0900 Subject: [PATCH 3/9] Fix some typos in comments. --- taglib/mpeg/id3v2/id3v2extendedheader.h | 2 +- taglib/riff/wav/infotag.h | 4 ++-- taglib/riff/wav/wavfile.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/taglib/mpeg/id3v2/id3v2extendedheader.h b/taglib/mpeg/id3v2/id3v2extendedheader.h index d7227e9d..d60200e7 100644 --- a/taglib/mpeg/id3v2/id3v2extendedheader.h +++ b/taglib/mpeg/id3v2/id3v2extendedheader.h @@ -38,7 +38,7 @@ namespace TagLib { /*! * This class implements ID3v2 extended headers. It attempts to follow, - * both semantically and programatically, the structure specified in + * both semantically and programatically, the structure specified in * the ID3v2 standard. The API is based on the properties of ID3v2 extended * headers specified there. If any of the terms used in this documentation * are unclear please check the specification in the linked section. diff --git a/taglib/riff/wav/infotag.h b/taglib/riff/wav/infotag.h index c99b59ac..440e7b93 100644 --- a/taglib/riff/wav/infotag.h +++ b/taglib/riff/wav/infotag.h @@ -89,12 +89,12 @@ namespace TagLib { { public: /*! - * Constructs an empty Info tag. + * Constructs an empty INFO tag. */ Tag(); /*! - * Constructs an Info tag read from \a data which is contents of "LIST" chunk. + * Constructs an INFO tag read from \a data which is contents of "LIST" chunk. */ Tag(const ByteVector &data); diff --git a/taglib/riff/wav/wavfile.h b/taglib/riff/wav/wavfile.h index 99bfda17..129d9537 100644 --- a/taglib/riff/wav/wavfile.h +++ b/taglib/riff/wav/wavfile.h @@ -63,7 +63,7 @@ namespace TagLib { NoTags = 0x0000, //! Matches ID3v2 tags. ID3v2 = 0x0001, - //! Matches Info tags. + //! Matches INFO tags. Info = 0x0002, //! Matches all tag types. AllTags = 0xffff From b9f898698dd95d9a410ac45e7b7a2e9483dc327b Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Sun, 23 Aug 2015 18:21:51 +0900 Subject: [PATCH 4/9] Revert "Remove some private data members not needed to carry." This reverts commit 7c17d32b3a8bc3ed718af3790452fec33ebd307b. --- taglib/ape/apetag.cpp | 36 ++++++++++++++++++++++-------------- taglib/ape/apetag.h | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index 00934dbb..e0c2a24e 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -46,7 +46,14 @@ using namespace APE; class APE::Tag::TagPrivate { public: + TagPrivate() : file(0), footerLocation(-1), tagLength(0) {} + + TagLib::File *file; + long footerLocation; + long tagLength; + Footer footer; + ItemListMap itemListMap; }; @@ -54,17 +61,18 @@ public: // public methods //////////////////////////////////////////////////////////////////////////////// -APE::Tag::Tag() : - TagLib::Tag(), - d(new TagPrivate()) +APE::Tag::Tag() : TagLib::Tag() { + d = new TagPrivate; } -APE::Tag::Tag(TagLib::File *file, long footerLocation) : - TagLib::Tag(), - d(new TagPrivate()) +APE::Tag::Tag(TagLib::File *file, long footerLocation) : TagLib::Tag() { - read(file, footerLocation); + d = new TagPrivate; + d->file = file; + d->footerLocation = footerLocation; + + read(); } APE::Tag::~Tag() @@ -319,19 +327,19 @@ bool APE::Tag::isEmpty() const // protected methods //////////////////////////////////////////////////////////////////////////////// -void APE::Tag::read(TagLib::File *file, long footerLocation) +void APE::Tag::read() { - if(file && file->isValid()) { + if(d->file && d->file->isValid()) { - file->seek(footerLocation); - d->footer.setData(file->readBlock(Footer::size())); + d->file->seek(d->footerLocation); + d->footer.setData(d->file->readBlock(Footer::size())); if(d->footer.tagSize() <= Footer::size() || - d->footer.tagSize() > uint(file->length())) + d->footer.tagSize() > uint(d->file->length())) return; - file->seek(footerLocation + Footer::size() - d->footer.tagSize()); - parse(file->readBlock(d->footer.tagSize() - Footer::size())); + d->file->seek(d->footerLocation + Footer::size() - d->footer.tagSize()); + parse(d->file->readBlock(d->footer.tagSize() - Footer::size())); } } diff --git a/taglib/ape/apetag.h b/taglib/ape/apetag.h index 6c9999cf..55572612 100644 --- a/taglib/ape/apetag.h +++ b/taglib/ape/apetag.h @@ -188,7 +188,7 @@ namespace TagLib { /*! * Reads from the file specified in the constructor. */ - void read(TagLib::File *file, long footerLocation); + void read(); /*! * Parses the body of the tag in \a data. From ac38f4ade1660a676591b8d1b14914d7657ea52c Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Sun, 23 Aug 2015 18:25:17 +0900 Subject: [PATCH 5/9] Remove an unused private data member. --- taglib/ape/apetag.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index e0c2a24e..312533fe 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -46,11 +46,12 @@ using namespace APE; class APE::Tag::TagPrivate { public: - TagPrivate() : file(0), footerLocation(-1), tagLength(0) {} + TagPrivate() : + file(0), + footerLocation(-1) {} TagLib::File *file; long footerLocation; - long tagLength; Footer footer; @@ -61,14 +62,16 @@ public: // public methods //////////////////////////////////////////////////////////////////////////////// -APE::Tag::Tag() : TagLib::Tag() +APE::Tag::Tag() : + TagLib::Tag(), + d(new TagPrivate()) { - d = new TagPrivate; } -APE::Tag::Tag(TagLib::File *file, long footerLocation) : TagLib::Tag() +APE::Tag::Tag(TagLib::File *file, long footerLocation) : + TagLib::Tag(), + d(new TagPrivate()) { - d = new TagPrivate; d->file = file; d->footerLocation = footerLocation; From 71bc17b5e60a7a14c624477f324d02f082aad8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 23 Aug 2015 11:50:05 +0200 Subject: [PATCH 6/9] Lalala --- taglib/asf/asffile.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp index d566c5f4..e8a68d81 100644 --- a/taglib/asf/asffile.cpp +++ b/taglib/asf/asffile.cpp @@ -23,9 +23,6 @@ * http://www.mozilla.org/MPL/ * ***************************************************************************/ -// The implementation of this class is based on the document found at: -// http://download.microsoft.com/download/8/0/5/80506BEB-C95A-47AE-99CF-0D6D6D028ABA/ASF_Specification.pdf - #include #include #include From 0178d47c852d760aa3d6aba07c6f607d0163f76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 23 Aug 2015 12:10:12 +0200 Subject: [PATCH 7/9] Don't use const ref to an integer in ChapterFrame --- taglib/mpeg/id3v2/frames/chapterframe.cpp | 4 ++-- taglib/mpeg/id3v2/frames/chapterframe.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/taglib/mpeg/id3v2/frames/chapterframe.cpp b/taglib/mpeg/id3v2/frames/chapterframe.cpp index ad471ecd..e11e2928 100644 --- a/taglib/mpeg/id3v2/frames/chapterframe.cpp +++ b/taglib/mpeg/id3v2/frames/chapterframe.cpp @@ -65,8 +65,8 @@ ChapterFrame::ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &dat } ChapterFrame::ChapterFrame(const ByteVector &elementID, - const TagLib::uint &startTime, const TagLib::uint &endTime, - const TagLib::uint &startOffset, const TagLib::uint &endOffset, + TagLib::uint startTime, TagLib::uint endTime, + TagLib::uint startOffset, TagLib::uint endOffset, const FrameList &embeddedFrames) : ID3v2::Frame("CHAP") { diff --git a/taglib/mpeg/id3v2/frames/chapterframe.h b/taglib/mpeg/id3v2/frames/chapterframe.h index 692895ee..36853062 100644 --- a/taglib/mpeg/id3v2/frames/chapterframe.h +++ b/taglib/mpeg/id3v2/frames/chapterframe.h @@ -61,10 +61,9 @@ namespace TagLib { * * All times are in milliseconds. */ - // BIC: There's no reason to use const-references with uints ChapterFrame(const ByteVector &elementID, - const uint &startTime, const uint &endTime, - const uint &startOffset, const uint &endOffset, + uint startTime, uint endTime, + uint startOffset, uint endOffset, const FrameList &embeddedFrames = FrameList()); /*! From 54cea3edc32c176cbf5617b7da3f3c5ccd830ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 23 Aug 2015 12:19:55 +0200 Subject: [PATCH 8/9] Reorganize NEWS to put new features first --- NEWS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 62015f05..248d8f1a 100644 --- a/NEWS +++ b/NEWS @@ -3,21 +3,23 @@ TagLib 1.10 (??? ??, 2015) 1.10 BETA: - * Fixed binary incompatible change in TagLib::String. - * Fixed crash when parsing certain FLAC files. - * Fixed crash when encoding empty strings. - * Fixed saving of certain XM files on OS X. - * Allowed Xiph and APE generic getters to return space-concatenated values. + * New API for the audio length in milliseconds. * Added support for ID3v2 ETCO and SYLT frames. * Added support for album artist in PropertyMap API of MP4 files. * Added support for embedded frames in ID3v2 CHAP and CTOC frames. + * Added support for AIFF-C files. + * Better handling of duplicate ID3v2 tags in MPEG files. + * Allowed generating taglib.pc on Windows. * Added ZLIB_SOURCE build option. + * Fixed backwards-incompatible change in TagLib::String when constructing UTF16 strings. + * Fixed crash when parsing certain FLAC files. + * Fixed crash when encoding empty strings. + * Fixed saving of certain XM files on OS X. + * Changed Xiph and APE generic getters to return space-concatenated values. * Fixed possible file corruptions when removing tags from WAV files. * Added support for MP4 files with 64-bit atoms in certain 64-bit environments. - * Better handling of duplicate ID3v2 tags in MPEG files. * Prevented ID3v2 padding from being too large. * Fixed crash when parsing corrupted APE files. - * Added support for AIFF-C files. * Fixed crash when parsing corrupted WAV files. * Fixed crash when parsing corrupted Ogg FLAC files. * Fixed crash when parsing corrupted MPEG files. @@ -28,12 +30,10 @@ TagLib 1.10 (??? ??, 2015) * Stopped writing empty ID3v2 frames. * Fixed possible file corruptions when saving WMA files. * Added TagLib::MP4::Tag::isEmpty(). - * Added accessors to manipulate MP4 tags . + * Added accessors to manipulate MP4 tags. * Fixed crash when parsing corrupted WavPack files. * Fixed seeking MPEG frames. - * Allowed generating taglib.pc on Windows. * Fixed reading FLAC files with zero-sized padding blocks. - * New API for the audio length in milliseconds. * Added support for reading the encoder information of WMA files. * Added support for reading the codec of WAV files. * Added support for multi channel WavPack files. From 35aa6c4e842872b1d9c11c08233f4a3f2e7d471e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 23 Aug 2015 20:09:22 +0200 Subject: [PATCH 9/9] Update date in NEWS --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 248d8f1a..5db9da59 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -TagLib 1.10 (??? ??, 2015) +TagLib 1.10 (Aug 23, 2015) ========================== 1.10 BETA: