diff options
| author | 2011-08-01 13:25:03 -0700 | |
|---|---|---|
| committer | 2011-08-01 13:25:03 -0700 | |
| commit | 35770345e4386502f1a82996fc6cf079138b9bd4 (patch) | |
| tree | a9da7e4ec1739a2ea451012ad744b319114eca20 | |
| parent | e346719a8fcc2a9d820d3640331613e7346cdb5e (diff) | |
| parent | 1c121f68fc6ac4abff17203b55253d6aeee64bc5 (diff) | |
Merge "SurfaceTexture: allow set_buffer_count(2)"
| -rw-r--r-- | libs/gui/SurfaceTexture.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 16755ad98b..4f51f03ddf 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -168,18 +168,18 @@ status_t SurfaceTexture::setBufferCount(int bufferCount) { } } + const int minBufferSlots = mSynchronousMode ? + MIN_SYNC_BUFFER_SLOTS : MIN_ASYNC_BUFFER_SLOTS; if (bufferCount == 0) { - const int minBufferSlots = mSynchronousMode ? - MIN_SYNC_BUFFER_SLOTS : MIN_ASYNC_BUFFER_SLOTS; mClientBufferCount = 0; bufferCount = (mServerBufferCount >= minBufferSlots) ? mServerBufferCount : minBufferSlots; return setBufferCountServerLocked(bufferCount); } - // We don't allow the client to set a buffer-count less than - // MIN_ASYNC_BUFFER_SLOTS (3), there is no reason for it. - if (bufferCount < MIN_ASYNC_BUFFER_SLOTS) { + if (bufferCount < minBufferSlots) { + LOGE("setBufferCount: requested buffer count (%d) is less than " + "minimum (%d)", bufferCount, minBufferSlots); return BAD_VALUE; } |