Fix release-mode audio
This commit is contained in:
parent
a0ec10fbea
commit
0bbaedae22
|
@ -302,7 +302,9 @@ X_STATUS AudioSystem::RegisterClient(uint32_t callback, uint32_t callback_arg,
|
||||||
auto index = unused_clients_.front();
|
auto index = unused_clients_.front();
|
||||||
|
|
||||||
auto client_semaphore = client_semaphores_[index];
|
auto client_semaphore = client_semaphores_[index];
|
||||||
assert_true(ReleaseSemaphore(client_semaphore, kMaximumQueuedFrames, NULL) == TRUE);
|
BOOL ret = ReleaseSemaphore(client_semaphore, kMaximumQueuedFrames, NULL);
|
||||||
|
assert_true(ret == TRUE);
|
||||||
|
|
||||||
AudioDriver* driver;
|
AudioDriver* driver;
|
||||||
auto result = CreateDriver(index, client_semaphore, &driver);
|
auto result = CreateDriver(index, client_semaphore, &driver);
|
||||||
if (XFAILED(result)) {
|
if (XFAILED(result)) {
|
||||||
|
@ -511,6 +513,7 @@ int AudioSystem::PrepareXMAPacket(XMAContext &context, XMAContextData &data) {
|
||||||
|
|
||||||
// Still have data to read.
|
// Still have data to read.
|
||||||
auto packet = input_buffer + input_offset_bytes;
|
auto packet = input_buffer + input_offset_bytes;
|
||||||
|
assert_true(input_offset_bytes % 2048 == 0);
|
||||||
context.decoder->PreparePacket(packet, seq_offset_bytes,
|
context.decoder->PreparePacket(packet, seq_offset_bytes,
|
||||||
XMAContextData::kBytesPerPacket,
|
XMAContextData::kBytesPerPacket,
|
||||||
sample_rate, channels);
|
sample_rate, channels);
|
||||||
|
|
|
@ -26,7 +26,10 @@ class XAudio2AudioDriver::VoiceCallback : public IXAudio2VoiceCallback {
|
||||||
void OnStreamEnd() {}
|
void OnStreamEnd() {}
|
||||||
void OnVoiceProcessingPassEnd() {}
|
void OnVoiceProcessingPassEnd() {}
|
||||||
void OnVoiceProcessingPassStart(uint32_t samples_required) {}
|
void OnVoiceProcessingPassStart(uint32_t samples_required) {}
|
||||||
void OnBufferEnd(void* context) { assert_true(ReleaseSemaphore(semaphore_, 1, NULL) == TRUE); }
|
void OnBufferEnd(void* context) {
|
||||||
|
BOOL ret = ReleaseSemaphore(semaphore_, 1, NULL);
|
||||||
|
assert_true(ret == TRUE);
|
||||||
|
}
|
||||||
void OnBufferStart(void* context) {}
|
void OnBufferStart(void* context) {}
|
||||||
void OnLoopEnd(void* context) {}
|
void OnLoopEnd(void* context) {}
|
||||||
void OnVoiceError(void* context, HRESULT result) {}
|
void OnVoiceError(void* context, HRESULT result) {}
|
||||||
|
|
Loading…
Reference in New Issue