aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2015-05-27 10:04:52 +0900
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2015-08-28 17:04:15 +0900
commit6d925da75e7dc84db22f3c7aee290136fa3878ea (patch)
tree54dc05bbac8f2732d8c911976ec5610a704dbcbe
parente178875b40e952fce8c81577310af194ec0322d8 (diff)
Skip both ID3v1 and APE tags when seeking the last MPEG frame.
-rw-r--r--taglib/mpeg/mpegfile.cpp11
1 files changed, 10 insertions, 1 deletions
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