1
0
Fork 0
forked from len0rd/rockbox

FS#13539: Resync mikmod plugin with upstream

Brings it up to libmikmod 3.3.12, relased 2024-12-31

Also fix a segfault that only happened on simulators when using
non-default samplerates.

Change-Id: I2ade2d72a00edab5395328fe76a88a88516aac72
This commit is contained in:
Solomon Peachy 2025-01-03 08:34:47 -05:00
parent 08c32cee7c
commit af7ed73f31
29 changed files with 1860 additions and 706 deletions

View file

@ -20,20 +20,14 @@
/*==============================================================================
$Id$
High-quality sample mixing routines, using a 32 bits mixing buffer,
interpolation, and sample smoothing to improve sound quality and remove
clicks.
==============================================================================*/
/*
Future Additions:
Low-Pass filter to remove annoying staticy buzz.
- Low-Pass filter to remove annoying staticy buzz.
*/
==============================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -1074,9 +1068,10 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
(vnf->flags&SF_LOOP)?idxlend:idxsize;
/* if the sample is not blocked... */
if((end==vnf->current)||(!vnf->increment))
if((vnf->increment>0 && vnf->current>=end) ||
(vnf->increment<0 && vnf->current<=end) || !vnf->increment) {
done=0;
else {
} else {
done=MIN((end-vnf->current)/vnf->increment+1,todo);
if(done<0) done=0;
}