From 82c2c2ca0056a2cce4b3c6e0b4817470b40ebab0 Mon Sep 17 00:00:00 2001 From: Vikram Panduranga Date: Wed, 10 Jan 2018 18:04:54 -0800 Subject: [PATCH] asoc: Fix read offset for compress capture with timestamp In a compress capture usecase, read offset guides to move buffer pointer based on buffer length. When timestamp is enabled read offset also needs to include timestamp header offset along with buffer length. This fix addresses the issue of null memory map handle due to incorrect read offset. Change-Id: I93c3ec588e77d535b6c7a4a0d832c1e7ea5f62a7 Signed-off-by: Vikram Panduranga --- asoc/msm-compress-q6-v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asoc/msm-compress-q6-v2.c b/asoc/msm-compress-q6-v2.c index 7ba582a0c3aa..c4fecdefa2b3 100644 --- a/asoc/msm-compress-q6-v2.c +++ b/asoc/msm-compress-q6-v2.c @@ -541,7 +541,7 @@ static int msm_compr_read_buffer(struct msm_compr_audio *prtd) return ret; } prtd->bytes_read += buffer_length; - prtd->bytes_read_offset += buffer_length; + prtd->bytes_read_offset += buffer_length + prtd->ts_header_offset; if (prtd->bytes_read_offset >= prtd->buffer_size) prtd->bytes_read_offset -= prtd->buffer_size;