summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Ray <aray@google.com>2013-05-30 00:19:04 -0700
committerAlex Ray <aray@google.com>2013-07-03 14:32:59 -0700
commit77ecfd76d79ba3e864ee8cea331e6fac41a1ea45 (patch)
treea7e3c9a7a3903b42a433fa7287475b32cdd501ce
parent2b286dab84b2a0524c1deed67fea92200e598c6e (diff)
downloadhardware_libhardware-77ecfd76d79ba3e864ee8cea331e6fac41a1ea45.zip
hardware_libhardware-77ecfd76d79ba3e864ee8cea331e6fac41a1ea45.tar.gz
hardware_libhardware-77ecfd76d79ba3e864ee8cea331e6fac41a1ea45.tar.bz2
modules: camera: only wait on valid acquire fence
Change-Id: I4f51e509d86722c18308f4f1312ca3379cffd795
-rw-r--r--modules/camera/Camera.cpp19
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;