summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-03-27 16:41:37 -0700
committerLajos Molnar <lajos@google.com>2014-03-27 17:08:00 -0700
commitf5ee327780ea2b538b8affafa8063f0ce0390fe0 (patch)
treed9cf368c102fd957979b9764795bcb23f752dc4e /media/libstagefright/OMXCodec.cpp
parentf622e2c78407b50806a53a06a89b2b6546420f55 (diff)
downloadframeworks_av-f5ee327780ea2b538b8affafa8063f0ce0390fe0.zip
frameworks_av-f5ee327780ea2b538b8affafa8063f0ce0390fe0.tar.gz
frameworks_av-f5ee327780ea2b538b8affafa8063f0ce0390fe0.tar.bz2
DO NOT MERGE: Revert "stagefright: allow for minUndequeuedBufs to be one less"
This reverts commit a0470879e25394cb85437366fa53ce8055cd556f. Bug: 13655631
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 070e438..79a9665 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1780,8 +1780,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
}
// FIXME: assume that surface is controlled by app (native window
// returns the number for the case when surface is not controlled by app)
- // FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported
- // For now, try to allocate 1 more buffer, but don't fail if unsuccessful
+ minUndequeuedBufs++;
// Use conservative allocation while also trying to reduce starvation
//
@@ -1789,11 +1788,10 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
// minimum needed for the consumer to be able to work
// 2. try to allocate two (2) additional buffers to reduce starvation from
// the consumer
- // plus an extra buffer to account for incorrect minUndequeuedBufs
- CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1",
+ CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d",
def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs);
- for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
+ for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) {
OMX_U32 newBufferCount =
def.nBufferCountMin + minUndequeuedBufs + extraBuffers;
def.nBufferCountActual = newBufferCount;
@@ -1812,7 +1810,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
return err;
}
}
- CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d+1",
+ CODEC_LOGI("OMX-buffers: min=%u actual=%u undeq=%d",
def.nBufferCountMin, def.nBufferCountActual, minUndequeuedBufs);
err = native_window_set_buffer_count(