fix .dmf loading..... again (I think)

This commit is contained in:
tildearrow 2023-04-10 01:09:58 -05:00
parent 8375256ff7
commit 9e615bb3aa
1 changed files with 2 additions and 1 deletions

View File

@ -902,13 +902,14 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
}
#endif
int scaledLen=(double)length/samplePitches[pitch];
int scaledLen=ceil((double)length/samplePitches[pitch]);
if (scaledLen>0) {
// resample
logD("%d: scaling from %d...",i,pitch);
short* newData=new short[scaledLen];
memset(newData,0,scaledLen*sizeof(short));
int k=0;
float mult=(float)(vol)/50.0f;
for (double j=0; j<length; j+=samplePitches[pitch]) {