mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[PORTCLS]
- Reset number of mappings and available data when a reset request arrives - Handle case where a get position request appears before an audio buffer arrives which results in divide by zero exception svn path=/trunk/; revision=45487
This commit is contained in:
parent
e2214c16ef
commit
f326fb3cb3
2 changed files with 15 additions and 4 deletions
|
@ -466,6 +466,11 @@ CIrpQueue::CancelBuffers()
|
|||
KsCancelIo(&m_IrpList, &m_IrpListLock);
|
||||
// reset stream start flag
|
||||
m_StartStream = FALSE;
|
||||
// reset number of mappings
|
||||
m_NumMappings = 0;
|
||||
// reset number of data available
|
||||
m_NumDataAvailable = 0;
|
||||
|
||||
// done
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -693,8 +693,11 @@ CPortPinWaveCyclic::UpdateCommonBuffer(
|
|||
|
||||
if (m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
|
||||
{
|
||||
// normalize position
|
||||
m_Position.PlayOffset = m_Position.PlayOffset % m_Position.WriteOffset;
|
||||
if (m_Position.WriteOffset)
|
||||
{
|
||||
// normalize position
|
||||
m_Position.PlayOffset = m_Position.PlayOffset % m_Position.WriteOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -742,8 +745,11 @@ CPortPinWaveCyclic::UpdateCommonBufferOverlap(
|
|||
|
||||
if (m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
|
||||
{
|
||||
// normalize position
|
||||
m_Position.PlayOffset = m_Position.PlayOffset % m_Position.WriteOffset;
|
||||
if (m_Position.WriteOffset)
|
||||
{
|
||||
// normalize position
|
||||
m_Position.PlayOffset = m_Position.PlayOffset % m_Position.WriteOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue