Merge "Handle failed requestBuffer after successful dequeueBuffer"

This commit is contained in:
Jesse Hall 2014-05-02 16:50:40 +00:00 committed by Android (Google) Code Review
commit 9471c69773

View File

@ -302,7 +302,12 @@ status_t VirtualDisplaySurface::dequeueBuffer(Source source,
} }
} }
if (result & BUFFER_NEEDS_REALLOCATION) { if (result & BUFFER_NEEDS_REALLOCATION) {
mSource[source]->requestBuffer(*sslot, &mProducerBuffers[pslot]); result = mSource[source]->requestBuffer(*sslot, &mProducerBuffers[pslot]);
if (result < 0) {
mProducerBuffers[pslot].clear();
mSource[source]->cancelBuffer(*sslot, *fence);
return result;
}
VDS_LOGV("dequeueBuffer(%s): buffers[%d]=%p fmt=%d usage=%#x", VDS_LOGV("dequeueBuffer(%s): buffers[%d]=%p fmt=%d usage=%#x",
dbgSourceStr(source), pslot, mProducerBuffers[pslot].get(), dbgSourceStr(source), pslot, mProducerBuffers[pslot].get(),
mProducerBuffers[pslot]->getPixelFormat(), mProducerBuffers[pslot]->getPixelFormat(),