mirror of
https://github.com/reactos/reactos.git
synced 2024-08-02 01:21:00 +00:00
- Fix retrieving audio position
svn path=/trunk/; revision=43869
This commit is contained in:
parent
46c8396918
commit
650fc71047
|
@ -354,7 +354,7 @@ DECLARE_INTERFACE_(IIrpQueue, IUnknown)
|
||||||
IN PVOID Tag) PURE;
|
IN PVOID Tag) PURE;
|
||||||
|
|
||||||
STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE;
|
STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE;
|
||||||
STDMETHOD_(VOID, PrintQueueStatus)(THIS) PURE;
|
STDMETHOD_(ULONG, GetCurrentIrpOffset)(THIS) PURE;
|
||||||
STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_
|
STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_
|
||||||
IN ULONG MinimumDataThreshold) PURE;
|
IN ULONG MinimumDataThreshold) PURE;
|
||||||
STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE;
|
STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE;
|
||||||
|
@ -403,7 +403,7 @@ DECLARE_INTERFACE_(IIrpQueue, IUnknown)
|
||||||
IN PVOID Tag); \
|
IN PVOID Tag); \
|
||||||
\
|
\
|
||||||
STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \
|
STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \
|
||||||
STDMETHODIMP_(VOID) PrintQueueStatus(THIS); \
|
STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); \
|
||||||
STDMETHODIMP_(VOID) SetMinimumDataThreshold( \
|
STDMETHODIMP_(VOID) SetMinimumDataThreshold( \
|
||||||
IN ULONG MinimumDataThreshold); \
|
IN ULONG MinimumDataThreshold); \
|
||||||
STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID)
|
STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID)
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
virtual ~CIrpQueue(){}
|
virtual ~CIrpQueue(){}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ULONG m_CurrentOffset;
|
volatile ULONG m_CurrentOffset;
|
||||||
LONG m_NumMappings;
|
LONG m_NumMappings;
|
||||||
ULONG m_NumDataAvailable;
|
ULONG m_NumDataAvailable;
|
||||||
BOOL m_StartStream;
|
BOOL m_StartStream;
|
||||||
|
@ -312,7 +312,7 @@ CIrpQueue::UpdateMapping(
|
||||||
// ASSERT(StreamHeader);
|
// ASSERT(StreamHeader);
|
||||||
|
|
||||||
// add to current offset
|
// add to current offset
|
||||||
m_CurrentOffset += BytesWritten;
|
InterlockedExchangeAdd((volatile PLONG)&m_CurrentOffset, (LONG)BytesWritten);
|
||||||
|
|
||||||
// decrement available data counter
|
// decrement available data counter
|
||||||
m_NumDataAvailable -= BytesWritten;
|
m_NumDataAvailable -= BytesWritten;
|
||||||
|
@ -559,11 +559,12 @@ CIrpQueue::HasLastMappingFailed()
|
||||||
return m_OutOfMapping;
|
return m_OutOfMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
CIrpQueue::PrintQueueStatus()
|
CIrpQueue::GetCurrentIrpOffset()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
return m_CurrentOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -218,7 +218,8 @@ PinWaveCyclicAudioPosition(
|
||||||
else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
|
else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
|
||||||
{
|
{
|
||||||
Position->PlayOffset = Pin->m_Position.PlayOffset % Pin->m_Position.WriteOffset;
|
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 @@ CPortPinWaveCyclic::HandleKsStream(
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
if (m_Capture)
|
m_Position.WriteOffset += Data;
|
||||||
m_Position.WriteOffset += Data;
|
|
||||||
else
|
|
||||||
m_Position.WriteOffset += Data;
|
|
||||||
|
|
||||||
return STATUS_PENDING;
|
return STATUS_PENDING;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue