From: Tsuda Kageyu Date: Fri, 12 Jun 2015 08:53:17 +0000 (+0900) Subject: MusePak: A bit more accurate calculation of the stream length. X-Git-Tag: v1.10beta~44^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a1c784eec47baa010db2233a1a6de4031761eb5;p=taglib MusePak: A bit more accurate calculation of the stream length. --- diff --git a/taglib/mpc/mpcfile.cpp b/taglib/mpc/mpcfile.cpp index 8c353244..fcf8d1b8 100644 --- a/taglib/mpc/mpcfile.cpp +++ b/taglib/mpc/mpcfile.cpp @@ -315,7 +315,19 @@ void MPC::File::read(bool readProperties, Properties::ReadStyle /* propertiesSty // Look for MPC metadata if(readProperties) { - d->properties = new Properties(this, length() - d->ID3v2Size - d->APESize); + long streamLength; + + if(d->hasAPE) + streamLength = d->APELocation; + else if(d->hasID3v1) + streamLength = d->ID3v1Location; + else + streamLength = length(); + + if(d->hasID3v2) + streamLength -= (d->ID3v2Location + d->ID3v2Size); + + d->properties = new Properties(this, streamLength); } }