From: Tsuda Kageyu Date: Tue, 26 May 2015 03:44:25 +0000 (+0900) Subject: MPEG: No need to get the length of an ID3v2 tag twice. X-Git-Tag: v1.10beta~43^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2c79bc084141ee1e84e389f26806f34f42db8d2;p=taglib MPEG: No need to get the length of an ID3v2 tag twice. --- diff --git a/taglib/mpeg/mpegproperties.cpp b/taglib/mpeg/mpegproperties.cpp index 8cf330a3..9fece404 100644 --- a/taglib/mpeg/mpegproperties.cpp +++ b/taglib/mpeg/mpegproperties.cpp @@ -29,8 +29,6 @@ #include "mpegproperties.h" #include "mpegfile.h" #include "xingheader.h" -#include "id3v2tag.h" -#include "id3v2header.h" #include "apetag.h" #include "apefooter.h" @@ -203,14 +201,11 @@ void MPEG::Properties::read(File *file) d->bitrate = firstHeader.bitrate(); - long long streamLength = file->length(); + long streamLength = file->length() - first; if(file->hasID3v1Tag()) streamLength -= 128; - if(file->hasID3v2Tag()) - streamLength -= file->ID3v2Tag()->header()->completeTagSize(); - if(file->hasAPETag()) streamLength -= file->APETag()->footer()->completeTagSize();