summaryrefslogtreecommitdiff
path: root/Modules/sunaudiodev.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-11 15:23:52 +0000
committerGuido van Rossum <guido@python.org>1997-04-11 15:23:52 +0000
commit1e0b19e9e48164e5905f295b3140ff6949d1a7e4 (patch)
tree8420e7df2c3d1009d64b034eb1d0d54ec27e5ad5 /Modules/sunaudiodev.c
parenta3d9e025931db00b7a774e20302c9933b6d288ee (diff)
downloadcpython-git-1e0b19e9e48164e5905f295b3140ff6949d1a7e4.tar.gz
Bugfix by Sjoerd:
/* x_ocount is in bytes, wheras play.samples is in frames */ /* we want frames */
Diffstat (limited to 'Modules/sunaudiodev.c')
-rw-r--r--Modules/sunaudiodev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/sunaudiodev.c b/Modules/sunaudiodev.c
index a587ac6aa1..6155445a61 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 *