=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/dev.c,v retrieving revision 1.100 retrieving revision 1.101 diff -c -r1.100 -r1.101 *** src/usr.bin/sndiod/dev.c 2021/04/28 05:05:05 1.100 --- src/usr.bin/sndiod/dev.c 2021/04/28 05:10:29 1.101 *************** *** 1,4 **** ! /* $OpenBSD: dev.c,v 1.100 2021/04/28 05:05:05 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: dev.c,v 1.101 2021/04/28 05:10:29 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * *************** *** 41,47 **** void dev_onmove(struct dev *, int); void dev_master(struct dev *, unsigned int); void dev_cycle(struct dev *); - int dev_getpos(struct dev *); struct dev *dev_new(char *, struct aparams *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); void dev_adjpar(struct dev *, int, int, int); --- 41,46 ---- *************** *** 301,307 **** struct sysex x; unsigned int fps; ! mtc->delta = MTC_SEC * dev_getpos(mtc->dev); if (mtc->dev->rate % (30 * 4 * mtc->dev->round) == 0) { mtc->fps_id = MTC_FPS_30; mtc->fps = 30; --- 300,306 ---- struct sysex x; unsigned int fps; ! mtc->delta = -MTC_SEC * (int)mtc->dev->bufsz; if (mtc->dev->rate % (30 * 4 * mtc->dev->round) == 0) { mtc->fps_id = MTC_FPS_30; mtc->fps = 30; *************** *** 900,914 **** } /* - * return the latency that a stream would have if it's attached - */ - int - dev_getpos(struct dev *d) - { - return (d->mode & MODE_PLAY) ? -d->bufsz : 0; - } - - /* * Create a sndio device */ struct dev * --- 899,904 ---- *************** *** 1991,1997 **** /* * N-th recorded block is the N-th played block */ ! s->sub.prime = -dev_getpos(d) / d->round; } s->skip = 0; --- 1981,1987 ---- /* * N-th recorded block is the N-th played block */ ! s->sub.prime = d->bufsz / d->round; } s->skip = 0; *************** *** 1999,2005 **** * get the current position, the origin is when the first sample * played and/or recorded */ ! s->delta = dev_getpos(d) * (int)s->round / (int)d->round; s->delta_rem = 0; if (s->mode & MODE_PLAY) { --- 1989,1995 ---- * get the current position, the origin is when the first sample * played and/or recorded */ ! s->delta = -(long long)d->bufsz * s->round / d->round; s->delta_rem = 0; if (s->mode & MODE_PLAY) {