mirror of https://github.com/ericonr/sndio.git
check that we run dev_cycle at block boundary
This commit is contained in:
parent
22b132cf3a
commit
285549a2fb
|
@ -318,6 +318,19 @@ dev_sio_run(void *arg)
|
||||||
d->sio.cstate = DEV_SIO_CYCLE;
|
d->sio.cstate = DEV_SIO_CYCLE;
|
||||||
break;
|
break;
|
||||||
case DEV_SIO_CYCLE:
|
case DEV_SIO_CYCLE:
|
||||||
|
#ifdef DEBUG
|
||||||
|
/*
|
||||||
|
* check that we're called at cycle boundary:
|
||||||
|
* either after a recorded block, or when POLLOUT is
|
||||||
|
* raised
|
||||||
|
*/
|
||||||
|
if (!((d->mode & MODE_REC) && d->prime == 0) &&
|
||||||
|
!(d->sio.events & POLLOUT)) {
|
||||||
|
dev_log(d);
|
||||||
|
log_puts(": cycle not at block boundary\n");
|
||||||
|
panic();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
dev_cycle(d);
|
dev_cycle(d);
|
||||||
if (d->mode & MODE_PLAY) {
|
if (d->mode & MODE_PLAY) {
|
||||||
d->sio.cstate = DEV_SIO_WRITE;
|
d->sio.cstate = DEV_SIO_WRITE;
|
||||||
|
@ -331,7 +344,8 @@ dev_sio_run(void *arg)
|
||||||
case DEV_SIO_WRITE:
|
case DEV_SIO_WRITE:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (d->sio.todo == 0) {
|
if (d->sio.todo == 0) {
|
||||||
log_puts("dev_sio_write: can't write data\n");
|
dev_log(d);
|
||||||
|
log_puts(": can't write data\n");
|
||||||
panic();
|
panic();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue