Browse Source

cmProc4.c : cmRecdPlayExec() now checks for NULL inputs and outputs.

master
Kevin Larke 10 years ago
parent
commit
921891bbf1
1 changed files with 14 additions and 4 deletions
  1. 14
    4
      cmProc4.c

+ 14
- 4
cmProc4.c View File

4492
 
4492
 
4493
   // copy first block to end of LA buffer
4493
   // copy first block to end of LA buffer
4494
   for(i=0; i<chCnt; ++i)
4494
   for(i=0; i<chCnt; ++i)
4495
-    cmVOS_Copy(p->laChs[i]+p->laSmpIdx,n0,iChs[i] + srcOffs);
4495
+    if( iChs[i] == NULL )
4496
+      cmVOS_Zero(p->laChs[i]+p->laSmpIdx,n0);
4497
+    else
4498
+      cmVOS_Copy(p->laChs[i]+p->laSmpIdx,n0,iChs[i] + srcOffs);
4496
 
4499
 
4497
   p->laSmpIdx += n0;
4500
   p->laSmpIdx += n0;
4498
 
4501
 
4500
   {
4503
   {
4501
     // copy second block to begin of LA buffer
4504
     // copy second block to begin of LA buffer
4502
     for(i=0; i<chCnt; ++i)
4505
     for(i=0; i<chCnt; ++i)
4503
-      cmVOS_Copy(p->laChs[i],n1,iChs[i] + srcOffs + n0);
4506
+      if( iChs[i] == NULL )
4507
+        cmVOS_Zero(p->laChs[i],n1);
4508
+      else
4509
+        cmVOS_Copy(p->laChs[i],n1,iChs[i] + srcOffs + n0);
4504
 
4510
 
4505
     p->laSmpIdx = n1; 
4511
     p->laSmpIdx = n1; 
4506
 
4512
 
4517
     unsigned n = cmMin(fp->allocCnt - fp->recdIdx,smpCnt);
4523
     unsigned n = cmMin(fp->allocCnt - fp->recdIdx,smpCnt);
4518
     unsigned i;
4524
     unsigned i;
4519
     for(i=0; i<p->chCnt; ++i)
4525
     for(i=0; i<p->chCnt; ++i)
4520
-      cmVOS_Copy(fp->chArray[i] + fp->recdIdx, n, iChs[i] );
4526
+      if( iChs[i] == NULL )
4527
+        cmVOS_Zero(fp->chArray[i] + fp->recdIdx, n );
4528
+      else
4529
+        cmVOS_Copy(fp->chArray[i] + fp->recdIdx, n, iChs[i] );
4521
 
4530
 
4522
     fp->recdIdx += n;
4531
     fp->recdIdx += n;
4523
 
4532
 
4536
     unsigned i;
4545
     unsigned i;
4537
 
4546
 
4538
     for(i=0; i<p->chCnt; ++i)
4547
     for(i=0; i<p->chCnt; ++i)
4539
-      cmVOS_MultVVS(oChs[i],n,fp->chArray[i] + fp->playIdx,gain);
4548
+      if( oChs[i] != NULL )
4549
+        cmVOS_MultVVS(oChs[i],n,fp->chArray[i] + fp->playIdx,gain);
4540
 
4550
 
4541
     fp->playIdx += n;
4551
     fp->playIdx += n;
4542
 
4552
 

Loading…
Cancel
Save