mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-13 19:49:36 +00:00
Fix audio queue consume overrun (caused shutdown crash due to multiple buffers being queued)
This commit is contained in:
@@ -204,6 +204,13 @@ namespace PortabilityLayer
|
|||||||
return;
|
return;
|
||||||
case AudioCommandTypes::kCallback:
|
case AudioCommandTypes::kCallback:
|
||||||
command.m_param.m_callback(this);
|
command.m_param.m_callback(this);
|
||||||
|
|
||||||
|
if (m_state != State_Idle)
|
||||||
|
{
|
||||||
|
// Child call changed state (i.e. callback called PushBuffer, which triggered a digest)
|
||||||
|
m_mutex->Unlock();
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
@@ -215,6 +222,8 @@ namespace PortabilityLayer
|
|||||||
|
|
||||||
void AudioChannelImpl::DigestBufferCommand(const void *dataPointer)
|
void AudioChannelImpl::DigestBufferCommand(const void *dataPointer)
|
||||||
{
|
{
|
||||||
|
assert(m_state == State_Idle);
|
||||||
|
|
||||||
// At this point, the buffer should already be validated and converted, and the data pointer should point at the data tag
|
// At this point, the buffer should already be validated and converted, and the data pointer should point at the data tag
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
memcpy(&length, dataPointer, 4);
|
memcpy(&length, dataPointer, 4);
|
||||||
|
|||||||
Reference in New Issue
Block a user