summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-04-20 14:57:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-04-20 14:57:25 -0700
commitfdce1ccd7e468f3229de8f4f1616d017465470cb (patch)
tree70db7cba31e30218aa77fa3458ef062dad0439c1 /media/libstagefright/OMXCodec.cpp
parent4acdadbd8195f4fb21ff4cb72f09f088097ddf3b (diff)
parentd2c6894b56a538aa807e20d3ef421807cd55c009 (diff)
downloadframeworks_av-fdce1ccd7e468f3229de8f4f1616d017465470cb.zip
frameworks_av-fdce1ccd7e468f3229de8f4f1616d017465470cb.tar.gz
frameworks_av-fdce1ccd7e468f3229de8f4f1616d017465470cb.tar.bz2
am 1e1edb2c: am 25dc5f30: Merge "Don\'t coalesce more than 250ms worth of encoded data into a single codec input buffer. This currently only applies to the component OMX.TI.AAC.decode, it is the only one to support coalescing in the first place." into froyo
Merge commit '1e1edb2c7376dbd9ca24bbeefbddbe4221f397a0' into kraken * commit '1e1edb2c7376dbd9ca24bbeefbddbe4221f397a0': Don't coalesce more than 250ms worth of encoded data into a single codec input buffer.
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 4da828e..21aa980 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -2014,9 +2014,12 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) {
(const uint8_t *)srcBuffer->data() + srcBuffer->range_offset(),
srcBuffer->range_length());
+ int64_t lastBufferTimeUs;
+ CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &lastBufferTimeUs));
+ CHECK(timestampUs >= 0);
+
if (offset == 0) {
- CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &timestampUs));
- CHECK(timestampUs >= 0);
+ timestampUs = lastBufferTimeUs;
}
offset += srcBuffer->range_length();
@@ -2029,6 +2032,13 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) {
if (!(mQuirks & kSupportsMultipleFramesPerInputBuffer)) {
break;
}
+
+ int64_t coalescedDurationUs = lastBufferTimeUs - timestampUs;
+
+ if (coalescedDurationUs > 250000ll) {
+ // Don't coalesce more than 250ms worth of encoded data at once.
+ break;
+ }
}
if (n > 1) {