diff options
author | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2015-05-27 10:04:52 +0900 |
---|---|---|
committer | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2015-08-28 17:04:15 +0900 |
commit | 6d925da75e7dc84db22f3c7aee290136fa3878ea (patch) | |
tree | 54dc05bbac8f2732d8c911976ec5610a704dbcbe | |
parent | e178875b40e952fce8c81577310af194ec0322d8 (diff) |
Skip both ID3v1 and APE tags when seeking the last MPEG frame.
-rw-r--r-- | taglib/mpeg/mpegfile.cpp | 11 |
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 |