Author: janderwald
Date: Sun Feb 7 16:35:00 2010
New Revision: 45487
URL:
http://svn.reactos.org/svn/reactos?rev=45487&view=rev
Log:
[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
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Sun Feb 7
16:35:00 2010
@@ -466,6 +466,11 @@
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;
}
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Sun
Feb 7 16:35:00 2010
@@ -693,8 +693,11 @@
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 @@
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;
+ }
}
}