PASDK-183: minor code cleanup.
authorChitresh Gupta <chitresh.g@pathpartnertech.com>
Wed, 29 Mar 2017 14:17:49 +0000 (19:47 +0530)
committerChitresh Gupta <chitresh.g@pathpartnertech.com>
Wed, 29 Mar 2017 14:17:49 +0000 (19:47 +0530)
pasdk/common/aspDecOpCircBuf_common.c
pasdk/common/aspDecOpCircBuf_common.h
pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
pasdk/test_dsp/framework/audioStreamInpProc.c

index 3448b2f6ae2522ea28de8706204929c79a6871ad..a135089fafc6a393ba0b432ab4cf101dd8c2b783 100644 (file)
@@ -112,7 +112,7 @@ Int cbReset(
         // clear PCM data
         for (i=0; i<pCb->maxAFChanNum; i++)
         {
-            memset(pAfCb->data.sample[i], pCb->maxAFSampCount, 0);
+            memset(pAfCb->data.sample[i], 0, pCb->maxAFSampCount);
         }
         
         // clear metadata
index a1b36444ed78a842dda624294f3fdb9de7dd5b82..207bbdbcd291a65eb094485605613d83fb845295 100644 (file)
@@ -81,8 +81,8 @@ All rights reserved.
 
 // DTS - TODO: to update for DTS
 #define ASP_DECOP_CB_MAX_NUM_AF_DTS         ( 10 )
-#define ASP_DECOP_CB_INIT_LAG_DTS           ( 3 )
-#define ASP_DECOP_CB_INIT_WRTIDX_DTS        ( 1 )
+#define ASP_DECOP_CB_INIT_LAG_DTS           ( 2 )
+#define ASP_DECOP_CB_INIT_WRTIDX_DTS        ( 3 )
 #define ASP_DECOP_CB_INIT_RDIDX_DTS         ( 0 )
 
 #define ASP_DECODE_CB_GATE_NAME             ( "AspDecOpCbGate" )
index a82614328d9c30124bf34bd55c1d81c0846a2834..7c5d0e664503fddba5c5f67cbd94f5883605d418 100644 (file)
@@ -314,14 +314,18 @@ Int cbWriteAf(
 
 
         // prepare metadata buffer pointers according to the metadata and buffer sizes
-        for (i=1; i < pAfWrt->numPrivateMetadata; i++)
+        for (i=0; i < pAfWrt->numPrivateMetadata; i++)
         {
-            UInt8 *nextMdBuf = (pAfCb->pafPrivateMetadata[i-1].pMdBuf + pAfWrt->pafPrivateMetadata[i-1].size);
+            UInt8 *nextMdBuf;
+            if(i == 0)
+               nextMdBuf = (pAfCb->pafPrivateMetadata[0].pMdBuf + pAfWrt->pafPrivateMetadata[0].size);
+            else
+               nextMdBuf = (pAfCb->pafPrivateMetadata[i-1].pMdBuf + pAfWrt->pafPrivateMetadata[i-1].size);
             if(nextMdBuf >= pCb->metaBufEnd) // metadata buffer overflow
             {
                 pAfCb->pafPrivateMetadata[i].pMdBuf = pCb->metaBuf;
             }
-            else
+            else if(i != 0)
             {
                 pAfCb->pafPrivateMetadata[i].pMdBuf = nextMdBuf;
             }
index 2382aa12cd2816a03b0bdd0b264d80c127816531..fe61bee72a9d3cf803019f8671dc97398fc39ab0 100644 (file)
@@ -156,7 +156,7 @@ Int cbInit(
         for (i=0; i<ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
         {
             pAfCb->data.sample[i] = pPcmBuf;
-            memset(pAfCb->data.sample[i], DEF_DEC_OP_FRAME_LEN, 0);
+            memset(pAfCb->data.sample[i], 0, DEF_DEC_OP_FRAME_LEN);
             pPcmBuf += DEF_DEC_OP_FRAME_LEN;
             
             pAfCb->data.samsiz[i] = 0;
@@ -416,7 +416,7 @@ Int cbInitSourceSel(
         for (i=0; i<pCb->maxAFChanNum; i++)
         {
             pAfCb->data.sample[i] = pPcmBuf;
-            memset(pAfCb->data.sample[i], pCb->maxAFSampCount, 0);
+            memset(pAfCb->data.sample[i], 0, pCb->maxAFSampCount);
             pPcmBuf += pCb->maxAFSampCount;
             
             pAfCb->data.samsiz[i] = 0;
index 318a5feb73b80179fdaa898c90fb4e4047b04fdf..a00036d99b443cbdcf335bb4a3fabb573c2ebb55 100644 (file)
@@ -873,8 +873,8 @@ Void taskAsipFxn(
         }
 
         // FL: debug, reset IB capture buffer
-        //capIbReset();
-        //Log_info0("capIbReset()");
+        capIbReset();
+        Log_info0("capIbReset()");
         
         // FL: send source select message to slave
         pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize); /* allocate message */
@@ -1907,7 +1907,7 @@ PAF_ASIT_autoProcessing(
     if (nbytes == -DIBERR_SYNC)
     {
         TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
-        return 0;
+        return nbytes;
     }
     if (nbytes != sizeof(PAF_InpBufConfig))
     {
@@ -2196,7 +2196,7 @@ PAF_ASIT_decodeProcessing(
                 if (((pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_THD)    ||
                      (pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DXP)    ||
                      (pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DTSHD)) &&
-                     (pAstCfg->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN))
+                     (pAstCfg->xDec[zMD].decodeStatus.sampleRate == PAF_SAMPLERATE_UNKNOWN))
 #endif
                 {
                     Int z;
@@ -2725,7 +2725,7 @@ PAF_ASIT_decodeInit(
                      (sourceSelect == PAF_SOURCE_DTSALL)
                     )
             {
-                frameLength = 8192; // TODO: Chitresh FIX ME
+                frameLength = 512; // TODO: Chitresh FIX ME
             }
             else
             {
@@ -3470,7 +3470,7 @@ PAF_ASIT_decodeDecode(
                      (sourceSelect == PAF_SOURCE_DTSALL)
                     )
             {
-                frameLength = 8192; // TODO: Chitresh FIX ME
+                frameLength = 512; // TODO: Chitresh FIX ME
             }
             else
             {