diff options
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/camera_stream.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index 9b5cd0c4..8e6ccb83 100644 --- a/src/android/camera_stream.cpp +++ b/src/android/camera_stream.cpp @@ -147,16 +147,16 @@ int CameraStream::process(const FrameBuffer &source, Camera3RequestDescriptor *request) { /* Handle waiting on fences on the destination buffer. */ - int fence = dest.fence; - if (fence != -1) { - int ret = waitFence(fence); - ::close(fence); - dest.fence = -1; + if (dest.fence != -1) { + int ret = waitFence(dest.fence); if (ret < 0) { LOG(HAL, Error) << "Failed waiting for fence: " - << fence << ": " << strerror(-ret); + << dest.fence << ": " << strerror(-ret); return ret; } + + ::close(dest.fence); + dest.fence = -1; } if (!postProcessor_) |