Merge "Don't retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
7fa6937407
@@ -317,11 +317,17 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
|
|||||||
setAudioSource(extractor->getTrack(i));
|
setAudioSource(extractor->getTrack(i));
|
||||||
haveAudio = true;
|
haveAudio = true;
|
||||||
|
|
||||||
sp<MetaData> fileMeta = extractor->getMetaData();
|
if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_VORBIS)) {
|
||||||
int32_t loop;
|
// Only do this for vorbis audio, none of the other audio
|
||||||
if (fileMeta != NULL
|
// formats even support this ringtone specific hack and
|
||||||
&& fileMeta->findInt32(kKeyAutoLoop, &loop) && loop != 0) {
|
// retrieving the metadata on some extractors may turn out
|
||||||
mFlags |= AUTO_LOOPING;
|
// to be very expensive.
|
||||||
|
sp<MetaData> fileMeta = extractor->getMetaData();
|
||||||
|
int32_t loop;
|
||||||
|
if (fileMeta != NULL
|
||||||
|
&& fileMeta->findInt32(kKeyAutoLoop, &loop) && loop != 0) {
|
||||||
|
mFlags |= AUTO_LOOPING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user