From b83c1fe4e793da269b9340c64f7032a9cc27809c Mon Sep 17 00:00:00 2001 From: Chien-Yu Chen Date: Thu, 10 Sep 2015 16:15:21 -0700 Subject: Camera3Device: Signal buffer returned after it failed Signal buffer returned even after it failed so the thread waiting for it can wake up sooner. Bug: 23981045 Change-Id: Iccbcc7ece2e0f6204da9c54f2bdd96ff6843a8f5 --- services/camera/libcameraservice/device3/Camera3Stream.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/camera/libcameraservice/device3/Camera3Stream.cpp b/services/camera/libcameraservice/device3/Camera3Stream.cpp index 691764f..96299b3 100644 --- a/services/camera/libcameraservice/device3/Camera3Stream.cpp +++ b/services/camera/libcameraservice/device3/Camera3Stream.cpp @@ -487,9 +487,12 @@ status_t Camera3Stream::returnBuffer(const camera3_stream_buffer &buffer, status_t res = returnBufferLocked(buffer, timestamp); if (res == OK) { fireBufferListenersLocked(buffer, /*acquired*/false, /*output*/true); - mOutputBufferReturnedSignal.signal(); } + // Even if returning the buffer failed, we still want to signal whoever is waiting for the + // buffer to be returned. + mOutputBufferReturnedSignal.signal(); + return res; } -- cgit v1.1