=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/dev.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/sndiod/dev.c 2015/11/25 18:51:08 1.22 --- src/usr.bin/sndiod/dev.c 2016/01/08 16:17:31 1.23 *************** *** 1,4 **** ! /* $OpenBSD: dev.c,v 1.22 2015/11/25 18:51:08 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: dev.c,v 1.23 2016/01/08 16:17:31 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * *************** *** 547,558 **** if (s->mode & MODE_PLAY) { abuf_rdiscard(&s->mix.buf, s->round * s->mix.bpf); } ! s->skip--; } return max - s->skip; } ! int play_filt_resamp(struct slot *s, void *res_in, void *out, int todo) { int i, offs, vol, nch; --- 547,558 ---- if (s->mode & MODE_PLAY) { abuf_rdiscard(&s->mix.buf, s->round * s->mix.bpf); } ! s->skip--; } return max - s->skip; } ! int play_filt_resamp(struct slot *s, void *res_in, void *out, int todo) { int i, offs, vol, nch; *************** *** 582,588 **** return todo; } ! int play_filt_dec(struct slot *s, void *in, void *out, int todo) { void *tmp; --- 582,588 ---- return todo; } ! int play_filt_dec(struct slot *s, void *in, void *out, int todo) { void *tmp; *************** *** 663,669 **** } } ! int rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo) { int i, vol, offs, nch; --- 663,669 ---- } } ! int rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo) { int i, vol, offs, nch; *************** *** 692,698 **** return todo; } ! int rec_filt_enc(struct slot *s, void *in, void *out, int todo) { void *tmp; --- 692,698 ---- return todo; } ! int rec_filt_enc(struct slot *s, void *in, void *out, int todo) { void *tmp; *************** *** 847,857 **** dev_mix_adjvol(d); continue; } ! /* * check for xruns */ ! if (((s->mode & MODE_PLAY) && s->mix.buf.used < s->round * s->mix.bpf) || ((s->mode & MODE_RECMASK) && s->sub.buf.len - s->sub.buf.used < --- 847,857 ---- dev_mix_adjvol(d); continue; } ! /* * check for xruns */ ! if (((s->mode & MODE_PLAY) && s->mix.buf.used < s->round * s->mix.bpf) || ((s->mode & MODE_RECMASK) && s->sub.buf.len - s->sub.buf.used < *************** *** 917,923 **** dev_onmove(struct dev *d, int delta) { long long pos; ! struct slot *s, *snext; d->delta += delta; --- 917,923 ---- dev_onmove(struct dev *d, int delta) { long long pos; ! struct slot *s, *snext; d->delta += delta; *************** *** 1286,1296 **** } d->poffs = 0; ! /* * empty cycles don't increment delta, so it's ok to * start at 0 **/ ! d->delta = 0; d->pstate = DEV_RUN; dev_sio_start(d); --- 1286,1296 ---- } d->poffs = 0; ! /* * empty cycles don't increment delta, so it's ok to * start at 0 **/ ! d->delta = 0; d->pstate = DEV_RUN; dev_sio_start(d); *************** *** 1608,1614 **** * start the device if not started */ dev_wakeup(d); ! /* * get the current position, the origin is when the first sample * played and/or recorded --- 1608,1614 ---- * start the device if not started */ dev_wakeup(d); ! /* * get the current position, the origin is when the first sample * played and/or recorded *************** *** 1710,1716 **** s->sub.encbuf = xmalloc(s->round * slot_nch * sizeof(adata_t)); } ! /* * N-th recorded block is the N-th played block */ --- 1710,1716 ---- s->sub.encbuf = xmalloc(s->round * slot_nch * sizeof(adata_t)); } ! /* * N-th recorded block is the N-th played block */ *************** *** 1728,1734 **** /* * device may be disconnected, and if so we're called from * slot->ops->exit() on a closed device ! */ if (s->dev->pstate == DEV_CFG) return; if (s->tstate == MMC_OFF) --- 1728,1734 ---- /* * device may be disconnected, and if so we're called from * slot->ops->exit() on a closed device ! */ if (s->dev->pstate == DEV_CFG) return; if (s->tstate == MMC_OFF) *************** *** 1769,1775 **** log_puts("\n"); } #endif ! s->mix.bpf = s->par.bps * (s->mix.slot_cmax - s->mix.slot_cmin + 1); abuf_init(&s->mix.buf, bufsz * s->mix.bpf); } --- 1769,1775 ---- log_puts("\n"); } #endif ! s->mix.bpf = s->par.bps * (s->mix.slot_cmax - s->mix.slot_cmin + 1); abuf_init(&s->mix.buf, bufsz * s->mix.bpf); } *************** *** 1784,1790 **** log_puts("\n"); } #endif ! s->sub.bpf = s->par.bps * (s->sub.slot_cmax - s->sub.slot_cmin + 1); abuf_init(&s->sub.buf, bufsz * s->sub.bpf); } --- 1784,1790 ---- log_puts("\n"); } #endif ! s->sub.bpf = s->par.bps * (s->sub.slot_cmax - s->sub.slot_cmin + 1); abuf_init(&s->sub.buf, bufsz * s->sub.bpf); } *************** *** 1829,1835 **** panic(); } #endif ! } *ps = s->next; if (s->mode & MODE_RECMASK) { if (s->sub.encbuf) --- 1829,1835 ---- panic(); } #endif ! } *ps = s->next; if (s->mode & MODE_RECMASK) { if (s->sub.encbuf)