Mercurial > hg > dmlib
changeset 186:dc22e3f77c9a
Fix tempo (callback frequency) calculation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 06 Oct 2012 16:25:15 +0300 |
parents | 1f8f4d7cb33b |
children | e59ea366b13d |
files | jssmix.c jssplr.c |
diffstat | 2 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/jssmix.c Sat Oct 06 15:34:29 2012 +0300 +++ b/jssmix.c Sat Oct 06 16:25:15 2012 +0300 @@ -465,13 +465,9 @@ { assert(mixer); - if (cbFreq < 1 || cbFreq >= mixer->outFreq) - JSSERROR(DMERR_INVALID_ARGS, DMERR_INVALID_ARGS, - "Invalid callback frequency given (%i / %i)\n", cbFreq, mixer->outFreq); - JSS_LOCK(mixer); - mixer->cbFreq = mixer->outFreq / cbFreq; + mixer->cbFreq = cbFreq; mixer->cbCounter = 0; //fprintf(stderr, "set(outFreq = %d, cbFreq = %d) = %d\n", mixer->outFreq, cbFreq, mixer->cbFreq);
--- a/jssplr.c Sat Oct 06 15:34:29 2012 +0300 +++ b/jssplr.c Sat Oct 06 16:25:15 2012 +0300 @@ -505,7 +505,7 @@ assert(mp->device != NULL); mp->tempo = tempo; - jvmSetCallbackFreq(mp->device, (tempo * 2) / 5); + jvmSetCallbackFreq(mp->device, (mp->device->outFreq * 5) / (tempo * 2)); JSS_UNLOCK(mp); }