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

Diff for /src/usr.bin/aucat/Attic/aproc.c between version 1.32 and 1.33

version 1.32, 2009/07/25 08:44:27 version 1.33, 2009/07/25 10:52:18
Line 49 
Line 49 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
 #include "conf.h"  
 #include "aparams.h"  
 #include "abuf.h"  #include "abuf.h"
   #include "aparams.h"
 #include "aproc.h"  #include "aproc.h"
   #include "conf.h"
 #include "file.h"  #include "file.h"
   
 struct aproc *  struct aproc *
Line 366 
Line 366 
   
 /*  /*
  * Append the given amount of silence (or less if there's not enough   * Append the given amount of silence (or less if there's not enough
  * space), and crank mixitodo accordingly   * space), and crank mixitodo accordingly.
  */   */
 void  void
 mix_bzero(struct abuf *obuf, unsigned zcount)  mix_bzero(struct abuf *obuf, unsigned zcount)
Line 398 
Line 398 
             obuf->mixitodo, ibuf->mixodone);              obuf->mixitodo, ibuf->mixodone);
   
         /*          /*
          * calculate the maximum we can read           * Calculate the maximum we can read.
          */           */
         idata = (short *)abuf_rgetblk(ibuf, &icount, 0);          idata = (short *)abuf_rgetblk(ibuf, &icount, 0);
         icount /= ibuf->bpf;          icount /= ibuf->bpf;
Line 406 
Line 406 
                 return;                  return;
   
         /*          /*
          * zero-fill if necessary           * Zero-fill if necessary.
          */           */
         zcount = ibuf->mixodone + icount * obuf->bpf;          zcount = ibuf->mixodone + icount * obuf->bpf;
         if (zcount > obuf->mixitodo)          if (zcount > obuf->mixitodo)
                 mix_bzero(obuf, zcount - obuf->mixitodo);                  mix_bzero(obuf, zcount - obuf->mixitodo);
   
         /*          /*
          * calculate the maximum we can write           * Calculate the maximum we can write.
          */           */
         odata = (short *)abuf_wgetblk(obuf, &ocount, ibuf->mixodone);          odata = (short *)abuf_wgetblk(obuf, &ocount, ibuf->mixodone);
         ocount /= obuf->bpf;          ocount /= obuf->bpf;
Line 566 
Line 566 
         if (!aproc_inuse(p)) {          if (!aproc_inuse(p)) {
                 DPRINTF("mix_eof: %s: from input\n", p->name);                  DPRINTF("mix_eof: %s: from input\n", p->name);
                 /*                  /*
                  * find a blocked input                   * Find a blocked input.
                  */                   */
                 odone = obuf->len;                  odone = obuf->len;
                 LIST_FOREACH(i, &p->ibuflist, ient) {                  LIST_FOREACH(i, &p->ibuflist, ient) {
Line 578 
Line 578 
                                 odone = i->mixodone;                                  odone = i->mixodone;
                 }                  }
                 /*                  /*
                  * no blocked inputs, check if output is blocked                   * No blocked inputs. Check if output is blocked.
                  */                   */
                 if (LIST_EMPTY(&p->ibuflist) || odone == obuf->mixitodo)                  if (LIST_EMPTY(&p->ibuflist) || odone == obuf->mixitodo)
                         abuf_run(obuf);                          abuf_run(obuf);
Line 651 
Line 651 
 }  }
   
 /*  /*
  * Normalize input levels   * Normalize input levels.
  */   */
 void  void
 mix_setmaster(struct aproc *p)  mix_setmaster(struct aproc *p)
Line 720 
Line 720 
 }  }
   
 /*  /*
  * Handle buffer overruns, return 0 if the stream died   * Handle buffer overruns. Return 0 if the stream died.
  */   */
 int  int
 sub_xrun(struct abuf *ibuf, struct abuf *i)  sub_xrun(struct abuf *ibuf, struct abuf *i)
Line 841 
Line 841 
         if (!aproc_inuse(p)) {          if (!aproc_inuse(p)) {
                 DPRINTF("sub_hup: %s: from input\n", p->name);                  DPRINTF("sub_hup: %s: from input\n", p->name);
                 /*                  /*
                  * find a blocked output                   * Find a blocked output.
                  */                   */
                 idone = ibuf->len;                  idone = ibuf->len;
                 LIST_FOREACH(i, &p->obuflist, oent) {                  LIST_FOREACH(i, &p->obuflist, oent) {
Line 853 
Line 853 
                                 idone = i->subidone;                                  idone = i->subidone;
                 }                  }
                 /*                  /*
                  * no blocked outputs, check if input is blocked                   * No blocked outputs. Check if input is blocked.
                  */                   */
                 if (LIST_EMPTY(&p->obuflist) || idone == ibuf->used)                  if (LIST_EMPTY(&p->obuflist) || idone == ibuf->used)
                         abuf_run(ibuf);                          abuf_run(ibuf);

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33