mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[XMA] Added SignalWork calls in XMASetInputBuffer{0,1}Valid
This should wake up the XMA decoder worker thread when new audio data is provided instead of only when the contexts are initially enabled or decoder is shutting down.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user