summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 04:46:24 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 04:46:24 +0000
commitdbfa8cc1a1674331691264333b5d9d7b3f25d11c (patch)
treee484fb25d9196aa2588717be3c7b9049efd2b240
parent115060b90feee13b5ddc7312a51e4687671edeaa (diff)
parent6697d689b5dd3ee59acdf56ce28fdcf3aa5da3e6 (diff)
downloadsonivox-android14-mainline-appsearch-release.tar.gz
Snap for 10453563 from 6697d689b5dd3ee59acdf56ce28fdcf3aa5da3e6 to mainline-appsearch-releaseaml_ase_341510000aml_ase_341410000aml_ase_341310010aml_ase_341113000aml_ase_340913000android14-mainline-appsearch-release
Change-Id: Ifbec45041f1a05754c4906e17e0bfef5a4c1769e
-rw-r--r--arm-wt-22k/lib_src/eas_mdls.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/arm-wt-22k/lib_src/eas_mdls.c b/arm-wt-22k/lib_src/eas_mdls.c
index fac6987..6771261 100644
--- a/arm-wt-22k/lib_src/eas_mdls.c
+++ b/arm-wt-22k/lib_src/eas_mdls.c
@@ -1340,31 +1340,32 @@ static EAS_RESULT Parse_data (SDLS_SYNTHESIZER_DATA *pDLSData, EAS_I32 pos, EAS_
if ((result = EAS_HWFileSeek(pDLSData->hwInstData, pDLSData->fileHandle, pos)) != EAS_SUCCESS)
return result;
- p = pSample;
+ p = pSample;
- while (size)
+ while (size)
+ {
+ /* read a small chunk of data and convert it */
+ count = (size < SAMPLE_CONVERT_CHUNK_SIZE ? size : SAMPLE_CONVERT_CHUNK_SIZE);
+ if ((result = EAS_HWReadFile(pDLSData->hwInstData, pDLSData->fileHandle, convBuf, count, &count)) != EAS_SUCCESS)
{
- /* read a small chunk of data and convert it */
- count = (size < SAMPLE_CONVERT_CHUNK_SIZE ? size : SAMPLE_CONVERT_CHUNK_SIZE);
- if ((result = EAS_HWReadFile(pDLSData->hwInstData, pDLSData->fileHandle, convBuf, count, &count)) != EAS_SUCCESS)
- {
- return result;
- }
- size -= count;
- if (pWsmp->bitsPerSample == 16)
- {
- memcpy(p, convBuf, count);
- p += count >> 1;
- }
- else
+ return result;
+ }
+ size -= count;
+ if (pWsmp->bitsPerSample == 16)
+ {
+ memcpy(p, convBuf, count);
+ p += count >> 1;
+ }
+ else
+ {
+ for(i=0; i<count; i++)
{
- for(i=0; i<count; i++)
- {
- *p++ = (short)((convBuf[i] ^ 0x80) << 8);
- }
+ *p++ = (short)((convBuf[i] ^ 0x80) << 8);
}
-
}
+
+ }
+
/* for looped samples, copy the last sample to the end */
if (pWsmp->loopLength)
{