more reference player work

This commit is contained in:
tildearrow 2025-10-29 19:25:08 -05:00
parent c7fe8fea80
commit a49306b4bd
7 changed files with 34 additions and 5 deletions

View file

@ -569,6 +569,7 @@ void DivEngine::createNew(const char* description, String sysName, bool inBase64
BUSY_BEGIN;
renderSamples();
reset();
calcSongTimestamps();
BUSY_END;
}
@ -606,6 +607,7 @@ void DivEngine::createNewFromDefaults() {
BUSY_BEGIN;
renderSamples();
reset();
calcSongTimestamps();
BUSY_END;
}
@ -3999,6 +4001,9 @@ void DivEngine::quitDispatch() {
totalCmds=0;
lastCmds=0;
cmdsPerSecond=0;
if (filePlayerSync) {
if (curFilePlayer!=NULL) curFilePlayer->stop();
}
for (int i=0; i<DIV_MAX_CHANS; i++) {
isMuted[i]=0;
}

View file

@ -1573,7 +1573,7 @@ class DivEngine {
previewVol(1.0f),
filePlayerBufLen(0),
curFilePlayer(NULL),
filePlayerSync(true),
filePlayerSync(false),
filePlayerCueSeconds(0),
filePlayerCueMicros(0),
totalProcessed(0),

View file

@ -265,9 +265,9 @@ void DivFilePlayer::mix(float** buf, int chans, unsigned int size) {
while (rateAccum>=outRate) {
rateAccum-=outRate;
playPos++;
if (playPos>=(ssize_t)si.frames) {
/*if (playPos>=(ssize_t)si.frames) {
playPos=0;
}
}*/
}
} else {
for (int j=0; j<chans; j++) {