Author: janderwald
Date: Sat Oct 31 11:38:25 2009
New Revision: 43869
URL:
http://svn.reactos.org/svn/reactos?rev=43869&view=rev
Log:
- Fix retrieving audio position
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp
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/interfaces.hpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] Sat Oct 31
11:38:25 2009
@@ -354,7 +354,7 @@
IN PVOID Tag) PURE;
STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE;
- STDMETHOD_(VOID, PrintQueueStatus)(THIS) PURE;
+ STDMETHOD_(ULONG, GetCurrentIrpOffset)(THIS) PURE;
STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_
IN ULONG MinimumDataThreshold) PURE;
STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE;
@@ -403,7 +403,7 @@
IN PVOID Tag); \
\
STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \
- STDMETHODIMP_(VOID) PrintQueueStatus(THIS); \
+ STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); \
STDMETHODIMP_(VOID) SetMinimumDataThreshold( \
IN ULONG MinimumDataThreshold); \
STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID)
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] Sat Oct 31
11:38:25 2009
@@ -35,7 +35,7 @@
virtual ~CIrpQueue(){}
protected:
- ULONG m_CurrentOffset;
+ volatile ULONG m_CurrentOffset;
LONG m_NumMappings;
ULONG m_NumDataAvailable;
BOOL m_StartStream;
@@ -312,7 +312,7 @@
// ASSERT(StreamHeader);
// add to current offset
- m_CurrentOffset += BytesWritten;
+ InterlockedExchangeAdd((volatile PLONG)&m_CurrentOffset, (LONG)BytesWritten);
// decrement available data counter
m_NumDataAvailable -= BytesWritten;
@@ -559,11 +559,12 @@
return m_OutOfMapping;
}
-VOID
-NTAPI
-CIrpQueue::PrintQueueStatus()
-{
-
+ULONG
+NTAPI
+CIrpQueue::GetCurrentIrpOffset()
+{
+
+ return m_CurrentOffset;
}
VOID
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] Sat
Oct 31 11:38:25 2009
@@ -218,7 +218,8 @@
else if (Pin->m_ConnectDetails->Interface.Id ==
KSINTERFACE_STANDARD_LOOPED_STREAMING)
{
Position->PlayOffset = Pin->m_Position.PlayOffset %
Pin->m_Position.WriteOffset;
- Position->WriteOffset = Pin->m_IrpQueue->NumData();
+ Position->WriteOffset =
(ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset();
+ DPRINT("Play %lu Write %lu\n", Position->PlayOffset,
Position->WriteOffset);
}
@@ -606,10 +607,7 @@
if (NT_SUCCESS(Status))
{
- if (m_Capture)
- m_Position.WriteOffset += Data;
- else
- m_Position.WriteOffset += Data;
+ m_Position.WriteOffset += Data;
return STATUS_PENDING;
}