diff options
author | Andreas Huber <andih@google.com> | 2009-12-11 11:27:02 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-12-11 11:27:02 -0800 |
commit | 85adf5e56235bcea2f8991d983b94f4199e28faa (patch) | |
tree | def30b7d4de8a2d5547bcf76624d674f01d1f1e2 /media/libstagefright/codecs/aacdec | |
parent | d8729c597b9fe8cbdbf145bea0dbaec4f075015b (diff) | |
download | frameworks_base-85adf5e56235bcea2f8991d983b94f4199e28faa.zip frameworks_base-85adf5e56235bcea2f8991d983b94f4199e28faa.tar.gz frameworks_base-85adf5e56235bcea2f8991d983b94f4199e28faa.tar.bz2 |
Propagate duration from input to output only if available, support multiple full frames of audio per input buffer in AMR/AAC decoders.
Diffstat (limited to 'media/libstagefright/codecs/aacdec')
-rw-r--r-- | media/libstagefright/codecs/aacdec/AACDecoder.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/media/libstagefright/codecs/aacdec/AACDecoder.cpp b/media/libstagefright/codecs/aacdec/AACDecoder.cpp index 77bbe89..92059c5 100644 --- a/media/libstagefright/codecs/aacdec/AACDecoder.cpp +++ b/media/libstagefright/codecs/aacdec/AACDecoder.cpp @@ -128,16 +128,18 @@ sp<MetaData> AACDecoder::getFormat() { int32_t numChannels; int32_t sampleRate; - int64_t durationUs; CHECK(srcFormat->findInt32(kKeyChannelCount, &numChannels)); CHECK(srcFormat->findInt32(kKeySampleRate, &sampleRate)); - CHECK(srcFormat->findInt64(kKeyDuration, &durationUs)); sp<MetaData> meta = new MetaData; meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_RAW); meta->setInt32(kKeyChannelCount, numChannels); meta->setInt32(kKeySampleRate, sampleRate); - meta->setInt64(kKeyDuration, durationUs); + + int64_t durationUs; + if (srcFormat->findInt64(kKeyDuration, &durationUs)) { + meta->setInt64(kKeyDuration, durationUs); + } return meta; } |