proper BRR raw export

This commit is contained in:
tildearrow 2023-05-02 18:57:40 -05:00
parent b6ffcc8cf2
commit e3967c1f0a
1 changed files with 9 additions and 2 deletions

View File

@ -456,8 +456,15 @@ bool DivSample::saveRaw(const char* path) {
logE("could not save sample: %s!",strerror(errno));
return false;
}
if (depth==DIV_SAMPLE_DEPTH_BRR && getLoopStartPosition(DIV_SAMPLE_DEPTH_BRR)) {\
// TODO: BRR loop pos?
if (depth==DIV_SAMPLE_DEPTH_BRR) {
if (isLoopable()) {
unsigned short loopPos=getLoopStartPosition(DIV_SAMPLE_DEPTH_BRR);
fputc(loopPos&0xff,f);
fputc(loopPos>>8,f);
} else {
fputc(0,f);
fputc(0,f);
}
}
if (fwrite(getCurBuf(),1,getCurBufLen(),f)!=getCurBufLen()) {