summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2012-11-29 11:35:12 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-11-29 11:35:12 -0800
commit6eb50f7ad52687331e55400a161164a62b8ebd52 (patch)
tree18a2f828bb2b20997af83c541402a553ae2c763c /media/libstagefright
parenta6c87d18d0edf49ee5fa7c979f9d41b2febe4062 (diff)
parent45be8448daafeab8f37cb82cd2219f95bc218a6a (diff)
downloadframeworks_av-6eb50f7ad52687331e55400a161164a62b8ebd52.zip
frameworks_av-6eb50f7ad52687331e55400a161164a62b8ebd52.tar.gz
frameworks_av-6eb50f7ad52687331e55400a161164a62b8ebd52.tar.bz2
am ce8dcdf5: am 031c93df: Merge "Bug fix for the MediaPlayer::prepare() api."
* commit 'ce8dcdf5361dd5de8c86cf5b0308c71d519f98ca': Bug fix for the MediaPlayer::prepare() api.
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/MP3Extractor.cpp6
-rw-r--r--media/libstagefright/id3/ID3.cpp4
-rw-r--r--media/libstagefright/include/ID3.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/media/libstagefright/MP3Extractor.cpp b/media/libstagefright/MP3Extractor.cpp
index d94054b..380dab4 100644
--- a/media/libstagefright/MP3Extractor.cpp
+++ b/media/libstagefright/MP3Extractor.cpp
@@ -350,8 +350,10 @@ MP3Extractor::MP3Extractor(
mInitCheck = OK;
- // get iTunes-style gapless info if present
- ID3 id3(mDataSource);
+ // Get iTunes-style gapless info if present.
+ // When getting the id3 tag, skip the V1 tags to prevent the source cache
+ // from being iterated to the end of the file.
+ ID3 id3(mDataSource, true);
if (id3.isValid()) {
ID3::Iterator *com = new ID3::Iterator(id3, "COM");
if (com->done()) {
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);
}
}
diff --git a/media/libstagefright/include/ID3.h b/media/libstagefright/include/ID3.h
index 8714008..3028f56 100644
--- a/media/libstagefright/include/ID3.h
+++ b/media/libstagefright/include/ID3.h
@@ -35,7 +35,7 @@ struct ID3 {
ID3_V2_4,
};
- ID3(const sp<DataSource> &source);
+ ID3(const sp<DataSource> &source, bool ignoreV1 = false);
~ID3();
bool isValid() const;