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.
This commit is contained in:
Andreas Huber
2010-10-04 11:22:22 -07:00
committed by Android Git Automerger

View File

@@ -317,6 +317,11 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
setAudioSource(extractor->getTrack(i)); setAudioSource(extractor->getTrack(i));
haveAudio = true; haveAudio = true;
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(); sp<MetaData> fileMeta = extractor->getMetaData();
int32_t loop; int32_t loop;
if (fileMeta != NULL if (fileMeta != NULL
@@ -324,6 +329,7 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
mFlags |= AUTO_LOOPING; mFlags |= AUTO_LOOPING;
} }
} }
}
if (haveAudio && haveVideo) { if (haveAudio && haveVideo) {
break; break;