Author: janderwald
Date: Wed Feb 18 23:48:51 2009
New Revision: 39675
URL:
http://svn.reactos.org/svn/reactos?rev=39675&view=rev
Log:
- If the current irp buffer is finished, set the state to pause (fixes looping of last
sample)
- Use KeSetTimer if Irql is below equal DISPATCH_LEVEL
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/service_group.c
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] Wed Feb
18 23:48:51 2009
@@ -105,9 +105,10 @@
NTSTATUS Status;
IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)CONTAINING_RECORD(iface,
IPortPinWaveCyclicImpl, lpVtblServiceSink);
-#if 0
+
if (This->ActiveIrp && This->ActiveIrpOffset >=
This->ActiveIrpBufferSize)
{
+ This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_PAUSE);
if (KeGetCurrentIrql() > DISPATCH_LEVEL)
{
if (This->DelayedRequestInProgress)
@@ -140,7 +141,6 @@
return;
}
}
-#endif
if (!This->ActiveIrp)
{
@@ -186,7 +186,8 @@
}
else
{
- This->Stream->lpVtbl->Silence(This->Stream,
(PUCHAR)This->CommonBuffer + This->CommonBufferOffset, BytesToCopy);
+ This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_PAUSE);
+ return;
}
BufferLength = Position;
IrpLength = This->ActiveIrpBufferSize - This->ActiveIrpOffset;
@@ -209,6 +210,12 @@
BytesToCopy = min(BufferLength, IrpLength);
DPRINT1("Copying %u Remaining %u\n", BytesToCopy, IrpLength);
+
+ if (!BytesToCopy)
+ {
+ This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_PAUSE);
+ return;
+ }
This->DmaChannel->lpVtbl->CopyTo(This->DmaChannel,
(PUCHAR)This->CommonBuffer +
This->CommonBufferOffset,
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/service_group.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/service_group.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/service_group.c [iso-8859-1] Wed Feb
18 23:48:51 2009
@@ -211,8 +211,11 @@
if (This->Initialized)
{
- //KeSetTimer(&This->Timer, DueTime, &This->Dpc);
- KeInsertQueueDpc(&This->Dpc, NULL, NULL);
+ if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
+ KeSetTimer(&This->Timer, DueTime, &This->Dpc);
+ else
+ KeInsertQueueDpc(&This->Dpc, NULL, NULL);
+
KeClearEvent(&This->DpcEvent);
}
}