diff --git a/src/xenia/apu/xma_decoder.h b/src/xenia/apu/xma_decoder.h index 753ebe703..ac9453a88 100644 --- a/src/xenia/apu/xma_decoder.h +++ b/src/xenia/apu/xma_decoder.h @@ -51,6 +51,12 @@ class XmaDecoder { void Pause(); void Resume(); + void SignalWork() { + if (work_event_) { + work_event_->Set(); + } + } + protected: int GetContextId(uint32_t guest_ptr); diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc index b529ffc41..dbd07cf54 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc @@ -260,6 +260,12 @@ dword_result_t XMASetInputBuffer0Valid_entry(lpvoid_t context_ptr) { context.input_buffer_0_valid = 1; context.Store(context_ptr); + // Wake up the worker thread so it can process the new input data. + auto audio_system = kernel_state()->emulator()->audio_system(); + if (audio_system) { + audio_system->xma_decoder()->SignalWork(); + } + return 0; } DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer0Valid, kAudio, kImplemented, @@ -301,6 +307,12 @@ dword_result_t XMASetInputBuffer1Valid_entry(lpvoid_t context_ptr) { context.input_buffer_1_valid = 1; context.Store(context_ptr); + // Wake up the worker thread so it can process the new input data. + auto audio_system = kernel_state()->emulator()->audio_system(); + if (audio_system) { + audio_system->xma_decoder()->SignalWork(); + } + return 0; } DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer1Valid, kAudio, kImplemented,