sthal: handle failure of session restart properly
In buffering state, if restart session is failed, st capture
device can still leave as active, so later when session is
started again, st capture device won't be enabled.
Tear down the session to disable st capture device when restart
failed.
Change-Id: Id1caa6c190f1b21e7c97ea93ee667964154abeff
diff --git a/st_session.c b/st_session.c
index 2ae2d81..ec68a69 100644
--- a/st_session.c
+++ b/st_session.c
@@ -2646,7 +2646,12 @@
st_ses->hw_session_started = true;
} else {
ALOGE("%s:[%d] failed to restart", __func__, st_ses->sm_handle);
- st_ses->hw_session_started = false;
+ /*
+ * lower layers like gcs/lsm need to handle double stop calls properly
+ * to avoid possible crash, as some of the clean ups are already issued
+ * during fptrs->restart() when it's failed.
+ */
+ stop_hw_session(st_ses, hw_ses, true);
}
return status;