mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Fix debug messages in AudioProperties classes.
This commit is contained in:
parent
ba2167ef92
commit
30551864fa
@ -149,7 +149,7 @@ void APE::AudioProperties::read(File *file, offset_t streamLength)
|
||||
}
|
||||
|
||||
if(version < 0) {
|
||||
debug("APE::Properties::read() -- APE descriptor not found");
|
||||
debug("APE::AudioProperties::read() -- APE descriptor not found");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ void APE::AudioProperties::analyzeCurrent(File *file)
|
||||
file->seek(2, File::Current);
|
||||
const ByteVector descriptor = file->readBlock(44);
|
||||
if(descriptor.size() < 44) {
|
||||
debug("APE::Properties::analyzeCurrent() -- descriptor is too short.");
|
||||
debug("APE::AudioProperties::analyzeCurrent() -- descriptor is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ void APE::AudioProperties::analyzeCurrent(File *file)
|
||||
// Read the header
|
||||
const ByteVector header = file->readBlock(24);
|
||||
if(header.size() < 24) {
|
||||
debug("APE::Properties::analyzeCurrent() -- MAC header is too short.");
|
||||
debug("APE::AudioProperties::analyzeCurrent() -- MAC header is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ void APE::AudioProperties::analyzeOld(File *file)
|
||||
{
|
||||
const ByteVector header = file->readBlock(26);
|
||||
if(header.size() < 26) {
|
||||
debug("APE::Properties::analyzeOld() -- MAC header is too short.");
|
||||
debug("APE::AudioProperties::analyzeOld() -- MAC header is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ void APE::AudioProperties::analyzeOld(File *file)
|
||||
file->seek(16, File::Current);
|
||||
const ByteVector fmt = file->readBlock(28);
|
||||
if(fmt.size() < 28 || !fmt.startsWith("WAVEfmt ")) {
|
||||
debug("APE::Properties::analyzeOld() -- fmt header is too short.");
|
||||
debug("APE::AudioProperties::analyzeOld() -- fmt header is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ ByteVector FLAC::AudioProperties::signature() const
|
||||
void FLAC::AudioProperties::read(const ByteVector &data, offset_t streamLength)
|
||||
{
|
||||
if(data.size() < 18) {
|
||||
debug("FLAC::Properties::read() - FLAC properties must contain at least 18 bytes.");
|
||||
debug("FLAC::AudioProperties::read() - FLAC properties must contain at least 18 bytes.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ void MPC::AudioProperties::readSV8(File *file, offset_t streamLength)
|
||||
bool eof;
|
||||
const size_t packetSize = readSize(file, packetSizeLength, eof);
|
||||
if(eof) {
|
||||
debug("MPC::Properties::readSV8() - Reached to EOF.");
|
||||
debug("MPC::AudioProperties::readSV8() - Reached to EOF.");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ void MPC::AudioProperties::readSV8(File *file, offset_t streamLength)
|
||||
|
||||
const ByteVector data = file->readBlock(dataSize);
|
||||
if(data.size() != dataSize) {
|
||||
debug("MPC::Properties::readSV8() - dataSize doesn't match the actual data size.");
|
||||
debug("MPC::AudioProperties::readSV8() - dataSize doesn't match the actual data size.");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ void MPC::AudioProperties::readSV8(File *file, offset_t streamLength)
|
||||
// http://trac.musepack.net/wiki/SV8Specification#StreamHeaderPacket
|
||||
|
||||
if(dataSize <= 5) {
|
||||
debug("MPC::Properties::readSV8() - \"SH\" packet is too short to parse.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is too short to parse.");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -242,13 +242,13 @@ void MPC::AudioProperties::readSV8(File *file, offset_t streamLength)
|
||||
|
||||
d->sampleFrames = readSize(data, pos);
|
||||
if(pos > dataSize - 3) {
|
||||
debug("MPC::Properties::readSV8() - \"SH\" packet is corrupt.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt.");
|
||||
break;
|
||||
}
|
||||
|
||||
const ulong begSilence = readSize(data, pos);
|
||||
if(pos > dataSize - 2) {
|
||||
debug("MPC::Properties::readSV8() - \"SH\" packet is corrupt.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt.");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ void MPC::AudioProperties::readSV8(File *file, offset_t streamLength)
|
||||
// http://trac.musepack.net/wiki/SV8Specification#ReplaygainPacket
|
||||
|
||||
if(dataSize <= 9) {
|
||||
debug("MPC::Properties::readSV8() - \"RG\" packet is too short to parse.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"RG\" packet is too short to parse.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ void MPEG::AudioProperties::read(File *file)
|
||||
|
||||
const offset_t first = file->firstFrameOffset();
|
||||
if(first < 0) {
|
||||
debug("MPEG::Properties::read() -- Could not find a valid first MPEG frame in the stream.");
|
||||
debug("MPEG::AudioProperties::read() -- Could not find a valid first MPEG frame in the stream.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ void MPEG::AudioProperties::read(File *file)
|
||||
const Header firstHeader(file->readBlock(4));
|
||||
|
||||
if(!firstHeader.isValid()) {
|
||||
debug("MPEG::Properties::read() -- The first page header is invalid.");
|
||||
debug("MPEG::AudioProperties::read() -- The first page header is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -167,10 +167,10 @@ void Opus::AudioProperties::read(File *file)
|
||||
}
|
||||
}
|
||||
else {
|
||||
debug("Opus::Properties::read() -- The PCM values for the start or "
|
||||
debug("Opus::AudioProperties::read() -- The PCM values for the start or "
|
||||
"end of this file was incorrect.");
|
||||
}
|
||||
}
|
||||
else
|
||||
debug("Opus::Properties::read() -- Could not find valid first and last Ogg pages.");
|
||||
debug("Opus::AudioProperties::read() -- Could not find valid first and last Ogg pages.");
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ void Speex::AudioProperties::read(File *file)
|
||||
|
||||
const ByteVector data = file->packet(0);
|
||||
if(data.size() < 64) {
|
||||
debug("Speex::Properties::read() -- data is too short.");
|
||||
debug("Speex::AudioProperties::read() -- data is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -186,12 +186,12 @@ void Speex::AudioProperties::read(File *file)
|
||||
}
|
||||
}
|
||||
else {
|
||||
debug("Speex::Properties::read() -- Either the PCM values for the start or "
|
||||
debug("Speex::AudioProperties::read() -- Either the PCM values for the start or "
|
||||
"end of this file was incorrect or the sample rate is zero.");
|
||||
}
|
||||
}
|
||||
else
|
||||
debug("Speex::Properties::read() -- Could not find valid first and last Ogg pages.");
|
||||
debug("Speex::AudioProperties::read() -- Could not find valid first and last Ogg pages.");
|
||||
|
||||
// Alternative to the actual average bitrate.
|
||||
|
||||
|
@ -149,14 +149,14 @@ void Ogg::Vorbis::AudioProperties::read(File *file)
|
||||
|
||||
const ByteVector data = file->packet(0);
|
||||
if(data.size() < 28) {
|
||||
debug("Vorbis::Properties::read() -- data is too short.");
|
||||
debug("Ogg::Vorbis::AudioProperties::read() -- data is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
size_t pos = 0;
|
||||
|
||||
if(data.mid(pos, 7) != vorbisSetupHeaderID) {
|
||||
debug("Ogg::Vorbis::Properties::read() -- invalid Ogg::Vorbis identification header");
|
||||
debug("Ogg::Vorbis::AudioProperties::read() -- invalid Ogg::Vorbis identification header");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -201,12 +201,12 @@ void Ogg::Vorbis::AudioProperties::read(File *file)
|
||||
}
|
||||
}
|
||||
else {
|
||||
debug("Vorbis::Properties::read() -- Either the PCM values for the start or "
|
||||
debug("Ogg::Vorbis::AudioProperties::read() -- Either the PCM values for the start or "
|
||||
"end of this file was incorrect or the sample rate is zero.");
|
||||
}
|
||||
}
|
||||
else
|
||||
debug("Vorbis::Properties::read() -- Could not find valid first and last Ogg pages.");
|
||||
debug("Ogg::Vorbis::AudioProperties::read() -- Could not find valid first and last Ogg pages.");
|
||||
|
||||
// Alternative to the actual average bitrate.
|
||||
|
||||
|
@ -148,23 +148,23 @@ void RIFF::AIFF::AudioProperties::read(File *file)
|
||||
if(data.isEmpty())
|
||||
data = file->chunkData(i);
|
||||
else
|
||||
debug("RIFF::AIFF::Properties::read() - Duplicate 'COMM' chunk found.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - Duplicate 'COMM' chunk found.");
|
||||
}
|
||||
else if(name == "SSND") {
|
||||
if(streamLength == 0)
|
||||
streamLength = file->chunkDataSize(i) + file->chunkPadding(i);
|
||||
else
|
||||
debug("RIFF::AIFF::Properties::read() - Duplicate 'SSND' chunk found.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - Duplicate 'SSND' chunk found.");
|
||||
}
|
||||
}
|
||||
|
||||
if(data.size() < 18) {
|
||||
debug("RIFF::AIFF::Properties::read() - 'COMM' chunk not found or too short.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - 'COMM' chunk not found or too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(streamLength == 0) {
|
||||
debug("RIFF::AIFF::Properties::read() - 'SSND' chunk not found.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - 'SSND' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -144,35 +144,35 @@ void RIFF::WAV::AudioProperties::read(File *file)
|
||||
if(data.isEmpty())
|
||||
data = file->chunkData(i);
|
||||
else
|
||||
debug("RIFF::WAV::Properties::read() - Duplicate 'fmt ' chunk found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Duplicate 'fmt ' chunk found.");
|
||||
}
|
||||
else if(name == "data") {
|
||||
if(streamLength == 0)
|
||||
streamLength = file->chunkDataSize(i) + file->chunkPadding(i);
|
||||
else
|
||||
debug("RIFF::WAV::Properties::read() - Duplicate 'data' chunk found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Duplicate 'data' chunk found.");
|
||||
}
|
||||
else if(name == "fact") {
|
||||
if(totalSamples == 0)
|
||||
totalSamples = file->chunkData(i).toUInt32LE(0);
|
||||
else
|
||||
debug("RIFF::WAV::Properties::read() - Duplicate 'fact' chunk found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Duplicate 'fact' chunk found.");
|
||||
}
|
||||
}
|
||||
|
||||
if(data.size() < 16) {
|
||||
debug("RIFF::WAV::Properties::read() - 'fmt ' chunk not found or too short.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - 'fmt ' chunk not found or too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(streamLength == 0) {
|
||||
debug("RIFF::WAV::Properties::read() - 'data' chunk not found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - 'data' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
d->format = data.toUInt16LE(0);
|
||||
if(d->format != FORMAT_PCM && totalSamples == 0) {
|
||||
debug("RIFF::WAV::Properties::read() - Non-PCM format, but 'fact' chunk not found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Non-PCM format, but 'fact' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,12 +124,12 @@ int TrueAudio::AudioProperties::ttaVersion() const
|
||||
void TrueAudio::AudioProperties::read(const ByteVector &data, offset_t streamLength)
|
||||
{
|
||||
if(data.size() < 4) {
|
||||
debug("TrueAudio::Properties::read() -- data is too short.");
|
||||
debug("TrueAudio::AudioProperties::read() -- data is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!data.startsWith("TTA")) {
|
||||
debug("TrueAudio::Properties::read() -- invalid header signature.");
|
||||
debug("TrueAudio::AudioProperties::read() -- invalid header signature.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ void TrueAudio::AudioProperties::read(const ByteVector &data, offset_t streamLen
|
||||
// TTA2 headers are in development, and have a different format
|
||||
if(1 == d->version) {
|
||||
if(data.size() < 18) {
|
||||
debug("TrueAudio::Properties::read() -- data is too short.");
|
||||
debug("TrueAudio::AudioProperties::read() -- data is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -162,12 +162,12 @@ void WavPack::AudioProperties::read(File *file, offset_t streamLength)
|
||||
const ByteVector data = file->readBlock(32);
|
||||
|
||||
if(data.size() < 32) {
|
||||
debug("WavPack::Properties::read() -- data is too short.");
|
||||
debug("WavPack::AudioProperties::read() -- data is too short.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!data.startsWith("wvpk")) {
|
||||
debug("WavPack::Properties::read() -- Block header not found.");
|
||||
debug("WavPack::AudioProperties::read() -- Block header not found.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user