From: Guido van Rossum Date: Fri, 11 Apr 1997 15:23:52 +0000 (+0000) Subject: Bugfix by Sjoerd: X-Git-Tag: v1.5a1~181 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e0b19e9e48164e5905f295b3140ff6949d1a7e4;p=thirdparty%2FPython%2Fcpython.git 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 a587ac6aa181..6155445a61a9 100644 --- a/Modules/sunaudiodev.c +++ b/Modules/sunaudiodev.c @@ -271,7 +271,11 @@ sad_obufcount(self, args) 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 *