diff options
author | Alex Ray <aray@google.com> | 2013-05-30 00:19:04 -0700 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2013-07-03 14:32:59 -0700 |
commit | 77ecfd76d79ba3e864ee8cea331e6fac41a1ea45 (patch) | |
tree | a7e3c9a7a3903b42a433fa7287475b32cdd501ce /modules | |
parent | 2b286dab84b2a0524c1deed67fea92200e598c6e (diff) | |
download | hardware_libhardware-77ecfd76d79ba3e864ee8cea331e6fac41a1ea45.zip hardware_libhardware-77ecfd76d79ba3e864ee8cea331e6fac41a1ea45.tar.gz hardware_libhardware-77ecfd76d79ba3e864ee8cea331e6fac41a1ea45.tar.bz2 |
modules: camera: only wait on valid acquire fence
Change-Id: I4f51e509d86722c18308f4f1312ca3379cffd795
Diffstat (limited to 'modules')
-rw-r--r-- | modules/camera/Camera.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/modules/camera/Camera.cpp b/modules/camera/Camera.cpp index 137c5f6..10464cb 100644 --- a/modules/camera/Camera.cpp +++ b/modules/camera/Camera.cpp @@ -582,14 +582,17 @@ bool Camera::isValidReprocessSettings(const camera_metadata_t* /*settings*/) int Camera::processCaptureBuffer(const camera3_stream_buffer_t *in, camera3_stream_buffer_t *out) { - int res = sync_wait(in->acquire_fence, CAMERA_SYNC_TIMEOUT); - if (res == -ETIME) { - ALOGE("%s:%d: Timeout waiting on buffer acquire fence", __func__, mId); - return res; - } else if (res) { - ALOGE("%s:%d: Error waiting on buffer acquire fence: %s(%d)", - __func__, mId, strerror(-res), res); - return res; + if (in->acquire_fence != -1) { + int res = sync_wait(in->acquire_fence, CAMERA_SYNC_TIMEOUT); + if (res == -ETIME) { + ALOGE("%s:%d: Timeout waiting on buffer acquire fence", + __func__, mId); + return res; + } else if (res) { + ALOGE("%s:%d: Error waiting on buffer acquire fence: %s(%d)", + __func__, mId, strerror(-res), res); + return res; + } } out->stream = in->stream; |