From 0ae31fc8fe6b648732c70eace2ff356d8df13972 Mon Sep 17 00:00:00 2001 From: Mansoor Aftab Date: Thu, 11 Dec 2014 17:55:57 -0800 Subject: Camera3: Avoid starting streams twice The start method of some streams (most notably the metadata) could be called twice. This scenario should be handled by returning immediatly and avoiding the initialization of new threads and resources. This change is authored by Emilian Peev Bug: 18258028 Bug: 17912331 Change-Id: Ife6613bdca069bc63193802e0bb88273e63998f9 Signed-off-by: Daniel Jarai --- camera/QCamera2/HAL3/QCamera3Channel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/camera/QCamera2/HAL3/QCamera3Channel.cpp b/camera/QCamera2/HAL3/QCamera3Channel.cpp index 9e18740..dccbdeb 100755 --- a/camera/QCamera2/HAL3/QCamera3Channel.cpp +++ b/camera/QCamera2/HAL3/QCamera3Channel.cpp @@ -246,6 +246,11 @@ int32_t QCamera3Channel::start() return NO_INIT; } + if(m_bIsActive) { + ALOGD("%s: Attempt to start active channel", __func__); + return rc; + } + for (int i = 0; i < m_numStreams; i++) { if (mStreams[i] != NULL) { mStreams[i]->start(); -- cgit v1.2.3