Fix bug in MediaBufferGroup new buffer allocation
MediaBufferGroup could allocate buffers of size 0, but this
was masked because we pre-allocated many more buffers. Now
that we allocate fewer buffers upfront, it's more likely
to hit this case.
Bug: 29125703
Test: CTS
Change-Id: Iba666f161be6d7c8bf09e1b48b1fd80750685a57
diff --git a/media/libmedia/IMediaSource.cpp b/media/libmedia/IMediaSource.cpp
index f185fd4..e7da488 100644
--- a/media/libmedia/IMediaSource.cpp
+++ b/media/libmedia/IMediaSource.cpp
@@ -186,6 +186,9 @@
ret = reply.readInt32();
ALOGV("readMultiple status %d, bufferCount %u, sinceStop %u",
ret, bufferCount, mBuffersSinceStop);
+ if (bufferCount && ret == WOULD_BLOCK) {
+ ret = OK;
+ }
return ret;
}