Merge "audio_hal: increase written frames size when HAL is in SSR"
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 96f252c..097583b 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2069,6 +2069,11 @@
pthread_mutex_lock(&out->lock);
if (SND_CARD_STATE_OFFLINE == snd_scard_state) {
+ // increase written size during SSR to avoid mismatch
+ // with the written frames count in AF
+ if (!is_offload_usecase(out->usecase))
+ out->written += bytes / (out->config.channels * sizeof(short));
+
if (out->pcm) {
ALOGD(" %s: sound card is not active/SSR state", __func__);
ret= -EIO;