summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/id3
diff options
context:
space:
mode:
authorDylan Powers <dylan.kyle.powers@gmail.com>2012-11-27 16:06:38 -0800
committerDylan Powers <dylan.kyle.powers@gmail.com>2012-11-27 18:18:44 -0800
commitffd6ffc5429c45577fd8e9f8fa90e79bb91b8a84 (patch)
tree7e8371e3616b38cf117de6e362eee06124548c3a /media/libstagefright/id3
parent5768fa034ede834656697d3612c525595ff85ef9 (diff)
downloadframeworks_av-ffd6ffc5429c45577fd8e9f8fa90e79bb91b8a84.zip
frameworks_av-ffd6ffc5429c45577fd8e9f8fa90e79bb91b8a84.tar.gz
frameworks_av-ffd6ffc5429c45577fd8e9f8fa90e79bb91b8a84.tar.bz2
Bug fix for the MediaPlayer::prepare() api.
For an MP3 source, within the prepare command, ID3 tags are checked in search of gapless playback info. This causes problems for streamed sources. If ID3v2 tags aren't present, then a check is done for ID3v1 tags. This results in a read command that asks the cache to jump to the end of the file, and subsequently make an extra http call to request those bytes. For a streamed source, this causes the file to not be downloaded automatically when MediaPlayer::prepare() is called, and causes stuttering and extra buffering time to be needed when start() is finally called. The solution is to ignore the ID3v1 tags as the gapless info would never exist there, and only check for ID3v2 tags. Change-Id: I7d1b94cffbfe7c38ca094834dedbc92a58855e20
Diffstat (limited to 'media/libstagefright/id3')
-rw-r--r--media/libstagefright/id3/ID3.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp
index 69274ca..22c2f5a 100644
--- a/media/libstagefright/id3/ID3.cpp
+++ b/media/libstagefright/id3/ID3.cpp
@@ -30,7 +30,7 @@ namespace android {
static const size_t kMaxMetadataSize = 3 * 1024 * 1024;
-ID3::ID3(const sp<DataSource> &source)
+ID3::ID3(const sp<DataSource> &source, bool ignoreV1)
: mIsValid(false),
mData(NULL),
mSize(0),
@@ -38,7 +38,7 @@ ID3::ID3(const sp<DataSource> &source)
mVersion(ID3_UNKNOWN) {
mIsValid = parseV2(source);
- if (!mIsValid) {
+ if (!mIsValid && !ignoreV1) {
mIsValid = parseV1(source);
}
}