WavPack: A bit more accurate calculation of the stream length.

This commit is contained in:
Tsuda Kageyu
2015-05-26 14:54:20 +09:00
parent 22f250eaa4
commit 8f6af3f020
3 changed files with 30 additions and 2 deletions

View File

@ -272,8 +272,19 @@ void WavPack::File::read(bool readProperties, Properties::ReadStyle /* propertie
// Look for WavPack audio properties
if(readProperties)
d->properties = new Properties(this, length() - d->APESize);
if(readProperties) {
long streamLength;
if(d->hasAPE)
streamLength = d->APELocation;
else if(d->hasID3v1)
streamLength = d->ID3v1Location;
else
streamLength = length();
d->properties = new Properties(this, streamLength);
}
}
long WavPack::File::findAPE()