Bugfix by Sjoerd:
/* x_ocount is in bytes, wheras play.samples is in frames */
/* we want frames */
diff --git a/Modules/sunaudiodev.c b/Modules/sunaudiodev.c
index a587ac6..6155445 100644
--- a/Modules/sunaudiodev.c
+++ b/Modules/sunaudiodev.c
@@ -271,7 +271,11 @@
PyErr_SetFromErrno(SunAudioError);
return NULL;
}
- return PyInt_FromLong(self->x_ocount - ai.play.samples);
+ /* x_ocount is in bytes, wheras play.samples is in frames */
+ /* we want frames */
+ return PyInt_FromLong(self->x_ocount / (ai.play.channels *
+ ai.play.precision / 8) -
+ ai.play.samples);
}
static PyObject *