[BACK]Return to dev.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / aucat

Diff for /src/usr.bin/aucat/Attic/dev.c between version 1.36 and 1.37

version 1.36, 2009/11/03 21:31:37 version 1.37, 2009/11/08 00:08:41
Line 372 
Line 372 
 {  {
         struct abuf *ibuf, *obuf;          struct abuf *ibuf, *obuf;
   
         if (sibuf) {          if (sibuf && *sibuf) {
                 ibuf = *sibuf;                  ibuf = *sibuf;
                 for (;;) {                  for (;;) {
                         if (!ibuf || !ibuf->rproc) {                          if (!ibuf || !ibuf->rproc) {
Line 384 
Line 384 
                 }                  }
                 *sibuf = ibuf;                  *sibuf = ibuf;
         }          }
         if (sobuf) {          if (sobuf && *sobuf) {
                 obuf = *sobuf;                  obuf = *sobuf;
                 for (;;) {                  for (;;) {
                         if (!obuf || !obuf->wproc) {                          if (!obuf || !obuf->wproc) {
Line 431 
Line 431 
         delta /= pbuf->bpf * rbuf->bpf;          delta /= pbuf->bpf * rbuf->bpf;
         if (delta > 0) {          if (delta > 0) {
                 /*                  /*
                  * If the play chain is ahead (most cases) drop some of                   * The play chain is ahead (most cases) drop some of
                  * the recorded input, to get both in sync.                   * the recorded input, to get both in sync.
                  */                   */
                 obuf->drop += delta * obuf->bpf;                  if (obuf) {
                 abuf_ipos(obuf, -delta);                          obuf->drop += delta * obuf->bpf;
                           abuf_ipos(obuf, -delta);
                   }
         } else if (delta < 0) {          } else if (delta < 0) {
                 /*                  /*
                  * If record chain is ahead (should never happen,                   * The record chain is ahead (should never happen,
                  * right?) then insert silence to play.                   * right?) then insert silence to play.
                  */                   */
                 ibuf->silence += -delta * ibuf->bpf;                   if (ibuf) {
                 abuf_opos(ibuf, delta);                          ibuf->silence += -delta * ibuf->bpf;
                           abuf_opos(ibuf, delta);
                   }
         }          }
 }  }
   
Line 579 
Line 583 
         if (ibuf && obuf) {          if (ibuf && obuf) {
                 ibuf->duplex = obuf;                  ibuf->duplex = obuf;
                 obuf->duplex = ibuf;                  obuf->duplex = ibuf;
                 dev_sync(ibuf, obuf);  
         }          }
           dev_sync(ibuf, obuf);
 }  }
   
 /*  /*

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37