From 8a5cc14ba4755e12b8971149b597a96dc38a1e91 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 25 Nov 2017 11:10:10 +0000 Subject: [PATCH] Audio/HLE/Source: Fix looped state not updating Bugfix for ff280800. --- src/audio_core/hle/source.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp index c12287700..0a9ac4007 100644 --- a/src/audio_core/hle/source.cpp +++ b/src/audio_core/hle/source.cpp @@ -277,11 +277,7 @@ bool Source::DequeueBuffer() { return false; Buffer buf = state.input_queue.top(); - - // if we're in a loop, the current sound keeps playing afterwards, so leave the queue alone - if (!buf.is_looping) { - state.input_queue.pop(); - } + state.input_queue.pop(); if (buf.adpcm_dirty) { state.adpcm_state.yn1 = buf.adpcm_yn[0]; @@ -321,7 +317,10 @@ bool Source::DequeueBuffer() { state.current_buffer_id = buf.buffer_id; state.buffer_update = buf.from_queue && !buf.has_played; - buf.has_played = true; + if (buf.is_looping) { + buf.has_played = true; + state.input_queue.push(buf); + } LOG_TRACE(Audio_DSP, "source_id=%zu buffer_id=%hu from_queue=%s current_buffer.size()=%zu", source_id, buf.buffer_id, buf.from_queue ? "true" : "false",