From: Tsuda Kageyu Date: Thu, 12 Nov 2015 04:52:46 +0000 (+0900) Subject: Skip both ID3v1 and APE tags when seeking the last MPEG frame. X-Git-Tag: v1.11beta~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94ff9124c7ca15fe1b91c7d525cdf511b2cc65d5;p=taglib Skip both ID3v1 and APE tags when seeking the last MPEG frame. --- diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp index 43075cfc..9ae1dffa 100644 --- a/taglib/mpeg/mpegfile.cpp +++ b/taglib/mpeg/mpegfile.cpp @@ -469,7 +469,16 @@ long MPEG::File::firstFrameOffset() long MPEG::File::lastFrameOffset() { - return previousFrameOffset(hasID3v1Tag() ? d->ID3v1Location - 1 : length()); + long position; + + if(hasAPETag()) + position = d->APELocation - 1; + else if(hasID3v1Tag()) + position = d->ID3v1Location - 1; + else + position = length(); + + return previousFrameOffset(position); } bool MPEG::File::hasID3v1Tag() const