From 18a21d5e9618695cbab0c19480c5a059d3111c58 Mon Sep 17 00:00:00 2001 From: Kevin Larke Date: Mon, 11 Aug 2014 11:44:26 -0700 Subject: [PATCH] cmDspKr.c : cmDspRecdPlayExec() now checks for disconnected inputs and outputs. --- dsp/cmDspKr.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/dsp/cmDspKr.c b/dsp/cmDspKr.c index a1d2c1d..3c3d9de 100644 --- a/dsp/cmDspKr.c +++ b/dsp/cmDspKr.c @@ -2715,26 +2715,37 @@ cmDspRC_t _cmDspRecdPlayExec(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_ for(i=0; ichCnt; ++i) { - if( i==0 ) - n = cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0); - else - { assert( n == cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0)); } - - x[i] = cmDspAudioBuf(ctx,inst,kInAudioBasePrId+i,0); - - if( x[i] != NULL ) + if( cmDspIsAudioInputConnected(ctx,inst,kInAudioBasePrId+i) == false ) { - y[i] = cmDspAudioBuf(ctx,inst,p->audioOutBaseId+i,0); - - if( y[i] != NULL ) - { - assert( n == cmDspAudioBufSmpCount(ctx,inst,p->audioOutBaseId+i,0)); - - cmVOS_Zero(y[i],n); - - actChCnt += 1; + x[i] = NULL; + y[i] = NULL; + } + else + { + if( i==0 ) + n = cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0); + else + { + + assert( n == cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0)); } + x[i] = cmDspAudioBuf(ctx,inst,kInAudioBasePrId+i,0); + + if( x[i] != NULL ) + { + y[i] = cmDspAudioBuf(ctx,inst,p->audioOutBaseId+i,0); + + if( y[i] != NULL ) + { + assert( n == cmDspAudioBufSmpCount(ctx,inst,p->audioOutBaseId+i,0)); + + cmVOS_Zero(y[i],n); + + actChCnt += 1; + } + + } } }