GB Audio: Fix giving blip the wrong diff when blocking
Vicki Pfau vi@endrift.com
Thu, 02 Aug 2018 23:11:14 -0700
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/gb/audio.c
→
src/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);