all repos — mgba @ 179c49e5f4c13fe79e136f85989406307d1a2ddd

mGBA Game Boy Advance Emulator

GB Audio: Fix giving blip the wrong diff when blocking
Vicki Pfau vi@endrift.com
Thu, 02 Aug 2018 23:11:14 -0700
commit

179c49e5f4c13fe79e136f85989406307d1a2ddd

parent

ec2e323d22001075f7b110502459a2d6dbbf7de2

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/gb/audio.csrc/gb/audio.c

@@ -647,6 +647,8 @@

if ((size_t) blip_samples_avail(audio->left) < audio->samples) { blip_add_delta(audio->left, audio->clock, sampleLeft - audio->lastLeft); blip_add_delta(audio->right, audio->clock, sampleRight - audio->lastRight); + audio->lastLeft = sampleLeft; + audio->lastRight = sampleRight; audio->clock += audio->sampleInterval; if (audio->clock >= CLOCKS_PER_BLIP_FRAME) { blip_end_frame(audio->left, CLOCKS_PER_BLIP_FRAME);

@@ -654,8 +656,6 @@ blip_end_frame(audio->right, CLOCKS_PER_BLIP_FRAME);

audio->clock -= CLOCKS_PER_BLIP_FRAME; } } - audio->lastLeft = sampleLeft; - audio->lastRight = sampleRight; produced = blip_samples_avail(audio->left); if (audio->p->stream && audio->p->stream->postAudioFrame) { audio->p->stream->postAudioFrame(audio->p->stream, sampleLeft, sampleRight);