Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e0b19e

Browse files
committed
Bugfix by Sjoerd:
/* x_ocount is in bytes, wheras play.samples is in frames */ /* we want frames */
1 parent a3d9e02 commit 1e0b19e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Modules/sunaudiodev.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,11 @@ sad_obufcount(self, args)
271271
PyErr_SetFromErrno(SunAudioError);
272272
return NULL;
273273
}
274-
return PyInt_FromLong(self->x_ocount - ai.play.samples);
274+
/* x_ocount is in bytes, wheras play.samples is in frames */
275+
/* we want frames */
276+
return PyInt_FromLong(self->x_ocount / (ai.play.channels *
277+
ai.play.precision / 8) -
278+
ai.play.samples);
275279
}
276280

277281
static PyObject *

0 commit comments

Comments
 (0)