diff options
author | Andreas Huber <andih@google.com> | 2010-10-04 11:22:22 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-04 11:22:22 -0700 |
commit | 66e3c30dc6c6e46bd56cb3dcd9fbd732c517a887 (patch) | |
tree | 17d1636681fa6a294ad4f06dcacc8217378b321c | |
parent | 97b4b6461f61f14f19cee147531de619816b11a7 (diff) | |
parent | 6954535ba64374e4e941cd83019a7af53edfb098 (diff) | |
download | frameworks_av-66e3c30dc6c6e46bd56cb3dcd9fbd732c517a887.zip frameworks_av-66e3c30dc6c6e46bd56cb3dcd9fbd732c517a887.tar.gz frameworks_av-66e3c30dc6c6e46bd56cb3dcd9fbd732c517a887.tar.bz2 |
am 7fa69374: Merge "Don\'t retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping." into gingerbread
Merge commit '7fa693740756123fa9d05e62fb47aae5d703c71d' into gingerbread-plus-aosp
* commit '7fa693740756123fa9d05e62fb47aae5d703c71d':
Don't retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping.
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 16 |
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; + } } } |