HLE DSP: Fix embedded buffer starting sample position

This commit is contained in:
wheremyfoodat 2024-07-29 23:46:36 +03:00
parent 57ecc18f32
commit 6668ba3e37

View file

@ -292,6 +292,9 @@ namespace Audio {
} }
if (config.embeddedBufferDirty) { if (config.embeddedBufferDirty) {
// Annoyingly, and only for embedded buffer, whether we use config.playPosition depends on the relevant dirty bit
const u32 playPosition = config.playPositionDirty ? config.playPosition : 0;
config.embeddedBufferDirty = 0; config.embeddedBufferDirty = 0;
if (s32(config.length) >= 0) [[likely]] { if (s32(config.length) >= 0) [[likely]] {
// TODO: Add sample format and channel count // TODO: Add sample format and channel count
@ -303,7 +306,7 @@ namespace Audio {
.adpcmDirty = config.adpcmDirty != 0, .adpcmDirty = config.adpcmDirty != 0,
.looping = config.isLooping != 0, .looping = config.isLooping != 0,
.bufferID = config.bufferID, .bufferID = config.bufferID,
.playPosition = config.playPosition, .playPosition = playPosition,
.format = source.sampleFormat, .format = source.sampleFormat,
.sourceType = source.sourceType, .sourceType = source.sourceType,
.fromQueue = false, .fromQueue = false,