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

Diff for /src/usr.bin/sndiod/dev.c between version 1.22 and 1.23

version 1.22, 2015/11/25 18:51:08 version 1.23, 2016/01/08 16:17:31
Line 547 
Line 547 
                 if (s->mode & MODE_PLAY) {                  if (s->mode & MODE_PLAY) {
                         abuf_rdiscard(&s->mix.buf, s->round * s->mix.bpf);                          abuf_rdiscard(&s->mix.buf, s->round * s->mix.bpf);
                 }                  }
                 s->skip--;                  s->skip--;
         }          }
         return max - s->skip;          return max - s->skip;
 }  }
   
 int  int
 play_filt_resamp(struct slot *s, void *res_in, void *out, int todo)  play_filt_resamp(struct slot *s, void *res_in, void *out, int todo)
 {  {
         int i, offs, vol, nch;          int i, offs, vol, nch;
Line 582 
Line 582 
         return todo;          return todo;
 }  }
   
 int  int
 play_filt_dec(struct slot *s, void *in, void *out, int todo)  play_filt_dec(struct slot *s, void *in, void *out, int todo)
 {  {
         void *tmp;          void *tmp;
Line 663 
Line 663 
         }          }
 }  }
   
 int  int
 rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo)  rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo)
 {  {
         int i, vol, offs, nch;          int i, vol, offs, nch;
Line 692 
Line 692 
         return todo;          return todo;
 }  }
   
 int  int
 rec_filt_enc(struct slot *s, void *in, void *out, int todo)  rec_filt_enc(struct slot *s, void *in, void *out, int todo)
 {  {
         void *tmp;          void *tmp;
Line 847 
Line 847 
                         dev_mix_adjvol(d);                          dev_mix_adjvol(d);
                         continue;                          continue;
                 }                  }
   
                 /*                  /*
                  * check for xruns                   * check for xruns
                  */                   */
                 if (((s->mode & MODE_PLAY) &&                  if (((s->mode & MODE_PLAY) &&
                         s->mix.buf.used < s->round * s->mix.bpf) ||                          s->mix.buf.used < s->round * s->mix.bpf) ||
                     ((s->mode & MODE_RECMASK) &&                      ((s->mode & MODE_RECMASK) &&
                         s->sub.buf.len - s->sub.buf.used <                          s->sub.buf.len - s->sub.buf.used <
Line 917 
Line 917 
 dev_onmove(struct dev *d, int delta)  dev_onmove(struct dev *d, int delta)
 {  {
         long long pos;          long long pos;
         struct slot *s, *snext;          struct slot *s, *snext;
   
         d->delta += delta;          d->delta += delta;
   
Line 1286 
Line 1286 
                 }                  }
                 d->poffs = 0;                  d->poffs = 0;
   
                 /*                  /*
                  * empty cycles don't increment delta, so it's ok to                   * empty cycles don't increment delta, so it's ok to
                  * start at 0                   * start at 0
                  **/                   **/
                 d->delta = 0;                  d->delta = 0;
   
                 d->pstate = DEV_RUN;                  d->pstate = DEV_RUN;
                 dev_sio_start(d);                  dev_sio_start(d);
Line 1608 
Line 1608 
          * start the device if not started           * start the device if not started
          */           */
         dev_wakeup(d);          dev_wakeup(d);
   
         /*          /*
          * get the current position, the origin is when the first sample           * get the current position, the origin is when the first sample
          * played and/or recorded           * played and/or recorded
Line 1710 
Line 1710 
                         s->sub.encbuf =                          s->sub.encbuf =
                             xmalloc(s->round * slot_nch * sizeof(adata_t));                              xmalloc(s->round * slot_nch * sizeof(adata_t));
                 }                  }
   
                 /*                  /*
                  * N-th recorded block is the N-th played block                   * N-th recorded block is the N-th played block
                  */                   */
Line 1728 
Line 1728 
         /*          /*
          * device may be disconnected, and if so we're called from           * device may be disconnected, and if so we're called from
          * slot->ops->exit() on a closed device           * slot->ops->exit() on a closed device
          */           */
         if (s->dev->pstate == DEV_CFG)          if (s->dev->pstate == DEV_CFG)
                 return;                  return;
         if (s->tstate == MMC_OFF)          if (s->tstate == MMC_OFF)
Line 1769 
Line 1769 
                         log_puts("\n");                          log_puts("\n");
                 }                  }
 #endif  #endif
                 s->mix.bpf = s->par.bps *                  s->mix.bpf = s->par.bps *
                     (s->mix.slot_cmax - s->mix.slot_cmin + 1);                      (s->mix.slot_cmax - s->mix.slot_cmin + 1);
                 abuf_init(&s->mix.buf, bufsz * s->mix.bpf);                  abuf_init(&s->mix.buf, bufsz * s->mix.bpf);
         }          }
Line 1784 
Line 1784 
                         log_puts("\n");                          log_puts("\n");
         }          }
 #endif  #endif
                 s->sub.bpf = s->par.bps *                  s->sub.bpf = s->par.bps *
                     (s->sub.slot_cmax - s->sub.slot_cmin + 1);                      (s->sub.slot_cmax - s->sub.slot_cmin + 1);
                 abuf_init(&s->sub.buf, bufsz * s->sub.bpf);                  abuf_init(&s->sub.buf, bufsz * s->sub.bpf);
         }          }
Line 1829 
Line 1829 
                         panic();                          panic();
                 }                  }
 #endif  #endif
         }          }
         *ps = s->next;          *ps = s->next;
         if (s->mode & MODE_RECMASK) {          if (s->mode & MODE_RECMASK) {
                 if (s->sub.encbuf)                  if (s->sub.encbuf)

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23