am bb506dab: am 7fa69374: Merge "Don\'t retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping." into gingerbread
Merge commit 'bb506dab1ff10e6939fcd0457571e0b46793dd80' * commit 'bb506dab1ff10e6939fcd0457571e0b46793dd80': Don't retrieve metadata unless necessary for ogg-vorbis ringtone auto-looping.
This commit is contained in:
@@ -320,11 +320,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user