Fixed bugs in Circular buffer.
authorChitresh Gupta <chitresh.g@pathpartnertech.com>
Wed, 5 Apr 2017 11:16:04 +0000 (16:46 +0530)
committerFrank Livingston <frank-livingston@ti.com>
Wed, 5 Apr 2017 19:32:08 +0000 (14:32 -0500)
(cherry picked from commit 7841834617070900de95310b598c7565d2eea2b9)

pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c

index ff970bf038b1dc70cd270990e0e380d78a8059f4..a5de2f00e80e75e6b16b24c0e9a23ffce3143dcf 100644 (file)
@@ -283,7 +283,7 @@ Int cbWriteAf(
         }
 
         pAfCbNextAf = &pCb->afCb[nextWrtIdx]; // +1 or last AF if overflow
-        pAfCbNextAf->data.sample[0] = &pAfCb->data.sample[PAF_MAX_NUM_PRIVATE_MD - 1][pAfWrt->sampleCount];// pAfCb->data.sample[15] + (pAfCb->sampleCount * sizeof(PAF_AudioData));
+        pAfCbNextAf->data.sample[0] = &pAfCb->data.sample[pCb->maxAFChanNum - 1][pAfWrt->sampleCount];// pAfCb->data.sample[15] + (pAfCb->sampleCount * sizeof(PAF_AudioData));
 
         // write audio frame information updated by decoder
         pAfCb->sampleDecode = pAfWrt->sampleDecode;
index 2e45fbbe8e772b6ac0b31def3dde357d66397e64..47bd334850dae532cc4635188544f473cbadec6b 100644 (file)
@@ -617,6 +617,10 @@ Int cbReadAf(
         // compute stream mask
         streamMask = pAfRd->fxns->channelMask(pAfRd, pAfCb->channelConfigurationStream);
 
+        // Invalidate channel pointers
+        Cache_inv(pAfCb->data.sample, pCb->maxAFChanNum*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
+        Cache_wait();
+
         // Invalidate PCM data
         for (i = 0; i < pCb->maxAFChanNum; i++)
         {