Browse Source

cmDspKr.c : cmDspRecdPlayExec() now checks for disconnected inputs and outputs.

master
Kevin Larke 9 years ago
parent
commit
18a21d5e96
1 changed files with 25 additions and 14 deletions
  1. 25
    14
      dsp/cmDspKr.c

+ 25
- 14
dsp/cmDspKr.c View File

@@ -2715,26 +2715,37 @@ cmDspRC_t _cmDspRecdPlayExec(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
2715 2715
 
2716 2716
   for(i=0; i<p->chCnt; ++i)
2717 2717
   {
2718
-    if( i==0 )
2719
-      n  = cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0);
2718
+    if( cmDspIsAudioInputConnected(ctx,inst,kInAudioBasePrId+i) == false )
2719
+    {
2720
+      x[i] = NULL;
2721
+      y[i] = NULL;
2722
+    }
2720 2723
     else
2721
-    { assert( n == cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0)); }
2722
-
2723
-    x[i] = cmDspAudioBuf(ctx,inst,kInAudioBasePrId+i,0);
2724
-
2725
-    if( x[i] != NULL )
2726 2724
     {
2727
-      y[i] = cmDspAudioBuf(ctx,inst,p->audioOutBaseId+i,0);
2728
-
2729
-      if( y[i] != NULL )
2725
+      if( i==0 )
2726
+        n  = cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0);
2727
+      else
2728
+      { 
2729
+        
2730
+        assert( n == cmDspAudioBufSmpCount(ctx,inst,kInAudioBasePrId+i,0)); 
2731
+      }
2732
+      
2733
+      x[i] = cmDspAudioBuf(ctx,inst,kInAudioBasePrId+i,0);
2734
+      
2735
+      if( x[i] != NULL )
2730 2736
       {
2731
-        assert( n == cmDspAudioBufSmpCount(ctx,inst,p->audioOutBaseId+i,0));
2737
+        y[i] = cmDspAudioBuf(ctx,inst,p->audioOutBaseId+i,0);
2738
+
2739
+        if( y[i] != NULL )
2740
+        {
2741
+          assert( n == cmDspAudioBufSmpCount(ctx,inst,p->audioOutBaseId+i,0));
2732 2742
 
2733
-        cmVOS_Zero(y[i],n);
2743
+          cmVOS_Zero(y[i],n);
2734 2744
 
2735
-        actChCnt += 1;
2736
-      }
2745
+          actChCnt += 1;
2746
+        }
2737 2747
       
2748
+      }
2738 2749
     }
2739 2750
   }
2740 2751
 

Loading…
Cancel
Save