sthal: Avoid second stage buffer duration adjustment if second stage is not enabled
Third party VA engines may use DSP non-generic event type. Currently second stage buffer
duration adjustment for non-generic events is done without considering whether second stage
is even present or not, which results in a crash. Fix it by checking if second stage is
enabled before adjusting the second stage buffer duration.
Change-Id: I71bac1edef076971cbba63c39ad5826dc8228ebf
diff --git a/st_hw_session_lsm.c b/st_hw_session_lsm.c
index ec2a63b..6252490 100644
--- a/st_hw_session_lsm.c
+++ b/st_hw_session_lsm.c
@@ -1552,7 +1552,7 @@
__func__, ftrt_bytes_written_ms, ((frame_send_time -
buffering_start_time) / NSECS_PER_MSEC));
- if (!p_lsm_ses->common.is_generic_event) {
+ if (p_lsm_ses->common.enable_second_stage && !p_lsm_ses->common.is_generic_event) {
ALOGD("%s: First real time frame took %llums", __func__,
(frame_read_time / NSECS_PER_MSEC));
adjust_ss_buff_end(&p_lsm_ses->common, cnn_append_bytes,