X-Git-Url: https://git.ti.com/gitweb?p=processor-sdk%2Fperformance-audio-sr.git;a=blobdiff_plain;f=processor_audio_sdk_1_00_00_00%2Fpasdk%2Ftest_dsp%2Fframework%2FaudioStreamOutProc.c;h=6438e654f71fd3f6039d1bba768f6becc0993326;hp=7d0b61271fe644663849a3fb7098e0d4b459cafa;hb=6d29937bcc4e795e4a416f01c9a9cfe5fa2c541c;hpb=e1c84d0a8c17d5d3276a4174b2256b787c54c2ac diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c index 7d0b6127..6438e654 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c @@ -119,6 +119,10 @@ PAF_ASOT_Config gPAF_ASOT_config = { &gPAF_AST_config // pAstCfg }; +// Underflow threshold before returning error to Top-Level FSM +#define DEC_OP_CB_RDAF_UND_THR ( 20 ) // FL: arbitrary setting +UInt32 gDecOpCbRdAfUnd =0; // decoder output circular buffer underflow count + // Global debug counters */ UInt32 gTaskAsopCnt=0; // debug UInt32 gAsopInitCnt =0; @@ -1842,7 +1846,7 @@ PAF_ASOT_decodeStream( Int zS = pP->streamsFromDecodes[z]; // - // (***) FL: read circular buffer + // Read decoder output circular buffer // pAfRd = pAstCfg->xStr[zS].pAudioFrame; cbErrno = cbReadAf(pCbCtl, z, pAfRd); @@ -1850,7 +1854,20 @@ PAF_ASOT_decodeStream( { TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno); //SW_BREAKPOINT; // FL: debug - //return cbErrno; // (***) FL: ignoring read failures?? + + if (cbErrno == ASP_DECOP_CB_READ_UNDERFLOW) + { + // Reset circular buffer + cbReset(pCbCtl, z); + + // Update underflow count, return if above threshold + gDecOpCbRdAfUnd++; + if (gDecOpCbRdAfUnd == DEC_OP_CB_RDAF_UND_THR) + { + gDecOpCbRdAfUnd = 0; + return cbErrno; + } + } } //Log_info0("PAF_ASOT_decodeStream:cbReadAf() complete.");