summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-04 11:09:31 -0700
committerAndreas Huber <andih@google.com>2010-10-04 11:09:31 -0700
commit1913c1aeabc1ff8d288c2be269fc50f010ad5f0f (patch)
tree6ddc307b936705f6c199890821b3983ffd72894e
parent106950f20bd352ed72ddf4490b2e19d305e36a74 (diff)
downloadframeworks_base-1913c1aeabc1ff8d288c2be269fc50f010ad5f0f.zip
frameworks_base-1913c1aeabc1ff8d288c2be269fc50f010ad5f0f.tar.gz
frameworks_base-1913c1aeabc1ff8d288c2be269fc50f010ad5f0f.tar.bz2
Don't retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping.
Change-Id: Iaf5880bb3376f9cbf22aefe198878eaf6f3f08c7 related-to-bug: 3037389
-rw-r--r--media/libstagefright/AwesomePlayer.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index c955ac3..3975866 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -317,11 +317,17 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
setAudioSource(extractor->getTrack(i));
haveAudio = true;
- sp<MetaData> fileMeta = extractor->getMetaData();
- int32_t loop;
- if (fileMeta != NULL
- && fileMeta->findInt32(kKeyAutoLoop, &loop) && loop != 0) {
- mFlags |= AUTO_LOOPING;
+ if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_VORBIS)) {
+ // Only do this for vorbis audio, none of the other audio
+ // formats even support this ringtone specific hack and
+ // retrieving the metadata on some extractors may turn out
+ // to be very expensive.
+ sp<MetaData> fileMeta = extractor->getMetaData();
+ int32_t loop;
+ if (fileMeta != NULL
+ && fileMeta->findInt32(kKeyAutoLoop, &loop) && loop != 0) {
+ mFlags |= AUTO_LOOPING;
+ }
}
}