From f5ee327780ea2b538b8affafa8063f0ce0390fe0 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Thu, 27 Mar 2014 16:41:37 -0700 Subject: DO NOT MERGE: Revert "stagefright: allow for minUndequeuedBufs to be one less" This reverts commit a0470879e25394cb85437366fa53ce8055cd556f. Bug: 13655631 --- media/libstagefright/ACodec.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'media/libstagefright/ACodec.cpp') diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 3ad3ca7..14d99cf 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -640,8 +640,8 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // 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 + (*minUndequeuedBuffers)++; + // Use conservative allocation while also trying to reduce starvation // @@ -649,8 +649,7 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( // 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 - for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) { + for (OMX_U32 extraBuffers = 2; /* condition inside loop */; extraBuffers--) { OMX_U32 newBufferCount = def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers; def.nBufferCountActual = newBufferCount; -- cgit v1.1