Merge "Avoid segfaults if disconnect USB camera while preview." am: 4dce57e459
am: 86ec58ff52
Change-Id: I748a644556eb2dd2e68a2e4e965d3b57e8ed4895
This commit is contained in:
commit
a169023679
1 changed files with 5 additions and 1 deletions
|
@ -1737,7 +1737,11 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() {
|
|||
// TODO: see if we can save some computation by converting to YV12 here
|
||||
uint8_t* inData;
|
||||
size_t inDataSize;
|
||||
req->frameIn->map(&inData, &inDataSize);
|
||||
if (req->frameIn->map(&inData, &inDataSize) != 0) {
|
||||
lk.unlock();
|
||||
return onDeviceError("%s: V4L2 buffer map failed", __FUNCTION__);
|
||||
}
|
||||
|
||||
// TODO: in some special case maybe we can decode jpg directly to gralloc output?
|
||||
ATRACE_BEGIN("MJPGtoI420");
|
||||
int res = libyuv::MJPGToI420(
|
||||
|
|
Loading…
Reference in a new issue