mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Merge branch 'master' into merge-master-to-taglib2
Conflicts: taglib/ape/apetag.cpp taglib/ape/apetag.h taglib/mpeg/id3v2/frames/chapterframe.cpp taglib/riff/wav/infotag.h
This commit is contained in:
commit
9b8f774fb3
22
NEWS
22
NEWS
@ -1,23 +1,25 @@
|
||||
TagLib 1.10 (??? ??, 2015)
|
||||
TagLib 1.10 (Aug 23, 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.
|
||||
|
@ -47,6 +47,7 @@ class APE::Tag::TagPrivate
|
||||
{
|
||||
public:
|
||||
Footer footer;
|
||||
|
||||
ItemListMap itemListMap;
|
||||
};
|
||||
|
||||
|
@ -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 <tdebug.h>
|
||||
#include <tbytevectorlist.h>
|
||||
#include <tpropertymap.h>
|
||||
|
@ -40,10 +40,7 @@ class DSF::File::FilePrivate
|
||||
public:
|
||||
FilePrivate() :
|
||||
properties(0),
|
||||
tag(0)
|
||||
{
|
||||
|
||||
}
|
||||
tag(0) {}
|
||||
|
||||
~FilePrivate()
|
||||
{
|
||||
@ -62,17 +59,19 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DSF::File::File(FileName file, bool readProperties,
|
||||
AudioProperties::ReadStyle propertiesStyle) : TagLib::File(file)
|
||||
AudioProperties::ReadStyle propertiesStyle) :
|
||||
TagLib::File(file),
|
||||
d(new FilePrivate())
|
||||
{
|
||||
d = new FilePrivate;
|
||||
if(isOpen())
|
||||
read(readProperties, propertiesStyle);
|
||||
}
|
||||
|
||||
DSF::File::File(IOStream *stream, bool readProperties,
|
||||
AudioProperties::ReadStyle propertiesStyle) : TagLib::File(stream)
|
||||
AudioProperties::ReadStyle propertiesStyle) :
|
||||
TagLib::File(stream),
|
||||
d(new FilePrivate())
|
||||
{
|
||||
d = new FilePrivate;
|
||||
if(isOpen())
|
||||
read(readProperties, propertiesStyle);
|
||||
}
|
||||
@ -168,7 +167,7 @@ void DSF::File::read(bool readProperties, AudioProperties::ReadStyle propertiesS
|
||||
{
|
||||
// A DSF file consists of four chunks: DSD chunk, format chunk, data chunk, and metadata chunk
|
||||
// The file format is not chunked in the sense of a RIFF File, though
|
||||
|
||||
|
||||
// DSD chunk
|
||||
ByteVector chunkName = readBlock(4);
|
||||
if(chunkName != "DSD ") {
|
||||
@ -178,14 +177,14 @@ void DSF::File::read(bool readProperties, AudioProperties::ReadStyle propertiesS
|
||||
}
|
||||
|
||||
long long chunkSize = readBlock(8).toInt64LE(0);
|
||||
|
||||
|
||||
// Integrity check
|
||||
if(28 != chunkSize) {
|
||||
debug("DSF::File::read() -- File is corrupted.");
|
||||
setValid(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
d->fileSize = readBlock(8).toInt64LE(0);
|
||||
|
||||
// File is malformed or corrupted
|
||||
@ -213,10 +212,10 @@ void DSF::File::read(bool readProperties, AudioProperties::ReadStyle propertiesS
|
||||
}
|
||||
|
||||
chunkSize = readBlock(8).toInt64LE(0);
|
||||
|
||||
d->properties
|
||||
|
||||
d->properties
|
||||
= new AudioProperties(readBlock(static_cast<size_t>(chunkSize)), propertiesStyle);
|
||||
|
||||
|
||||
// Skip the data chunk
|
||||
|
||||
// A metadata offset of 0 indicates the absence of an ID3v2 tag
|
||||
|
@ -43,10 +43,7 @@ public:
|
||||
sampleCount(0),
|
||||
blockSizePerChannel(0),
|
||||
bitrate(0),
|
||||
length(0)
|
||||
{
|
||||
|
||||
}
|
||||
length(0) {}
|
||||
|
||||
// Nomenclature is from DSF file format specification
|
||||
uint formatVersion;
|
||||
@ -67,9 +64,9 @@ public:
|
||||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DSF::AudioProperties::AudioProperties(const ByteVector &data, ReadStyle style)
|
||||
DSF::AudioProperties::AudioProperties(const ByteVector &data, ReadStyle style) :
|
||||
d(new PropertiesPrivate())
|
||||
{
|
||||
d = new PropertiesPrivate;
|
||||
read(data);
|
||||
}
|
||||
|
||||
@ -145,14 +142,14 @@ int DSF::AudioProperties::blockSizePerChannel() const
|
||||
|
||||
void DSF::AudioProperties::read(const ByteVector &data)
|
||||
{
|
||||
d->formatVersion = data.toUInt32LE(0);
|
||||
d->formatID = data.toUInt32LE(4);
|
||||
d->channelType = data.toUInt32LE(8);
|
||||
d->channelNum = data.toUInt32LE(12);
|
||||
d->samplingFrequency = data.toUInt32LE(16);
|
||||
d->bitsPerSample = data.toUInt32LE(20);
|
||||
d->sampleCount = data.toInt64LE(24);
|
||||
d->blockSizePerChannel = data.toUInt32LE(32);
|
||||
d->formatVersion = data.toUInt32LE(0);
|
||||
d->formatID = data.toUInt32LE(4);
|
||||
d->channelType = data.toUInt32LE(8);
|
||||
d->channelNum = data.toUInt32LE(12);
|
||||
d->samplingFrequency = data.toUInt32LE(16);
|
||||
d->bitsPerSample = data.toUInt32LE(20);
|
||||
d->sampleCount = data.toInt64LE(24);
|
||||
d->blockSizePerChannel = data.toUInt32LE(32);
|
||||
|
||||
d->bitrate = static_cast<int>(d->samplingFrequency * d->bitsPerSample * d->channelNum / 1000.0 + 0.5);
|
||||
|
||||
|
@ -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")
|
||||
{
|
||||
|
@ -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());
|
||||
|
||||
/*!
|
||||
|
@ -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.
|
||||
|
@ -48,11 +48,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().
|
||||
*
|
||||
@ -91,12 +91,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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -92,7 +92,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL((offset_t)2, file.rfind(ByteVector("23", 2), 6));
|
||||
|
||||
file.seek(0);
|
||||
const ByteVector v = file.readBlock(file.length());
|
||||
const ByteVector v = file.readBlock(static_cast<size_t>(file.length()));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)10, v.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((offset_t)v.rfind("23"), file.rfind("23"));
|
||||
|
Loading…
Reference in New Issue
Block a user