mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[MMEBUDDY]
- Check if there is a reset request in progress while the wave thread is active. In that case exit the wave buffer commiting activity - In the reset routine, perform an alertable wait in order to make the apc io completion complete [PORTCLS] - Only perform copying audio bytes to dma buffer while the adapter is reset state is KSREST_END - Set the reset state indicator before canceling the audio buffers - Should fix the audio hang experienced in Winamp when skipping audio bytes svn path=/trunk/; revision=50851
This commit is contained in:
parent
80cc7f2ee8
commit
38242931f1
2 changed files with 15 additions and 11 deletions
|
@ -823,7 +823,7 @@ CPortPinWaveCyclic::RequestService()
|
|||
|
||||
PC_ASSERT_IRQL(DISPATCH_LEVEL);
|
||||
|
||||
if (m_State == KSSTATE_RUN)
|
||||
if (m_State == KSSTATE_RUN && m_ResetState == KSRESET_END)
|
||||
{
|
||||
Status = m_Stream->GetPosition(&Position);
|
||||
|
||||
|
@ -904,13 +904,19 @@ CPortPinWaveCyclic::DeviceIoControl(
|
|||
/* check for success */
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
//determine state of reset request
|
||||
if (ResetValue == KSRESET_BEGIN)
|
||||
{
|
||||
m_IrpQueue->CancelBuffers();
|
||||
// start reset procress
|
||||
// incoming read/write requests will be rejected
|
||||
m_ResetState = KSRESET_BEGIN;
|
||||
|
||||
// cancel existing buffers
|
||||
m_IrpQueue->CancelBuffers();
|
||||
}
|
||||
else if (ResetValue == KSRESET_END)
|
||||
{
|
||||
// end of reset process
|
||||
m_ResetState = KSRESET_END;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ DoWaveStreaming(
|
|||
}
|
||||
|
||||
while ( ( SoundDeviceInstance->OutstandingBuffers < SoundDeviceInstance->BufferCount ) &&
|
||||
( Header ) )
|
||||
( Header ) && SoundDeviceInstance->ResetInProgress == FALSE)
|
||||
{
|
||||
HeaderExtension = (PWAVEHDR_EXTENSION) Header->reserved;
|
||||
SND_ASSERT( HeaderExtension );
|
||||
|
@ -176,8 +176,6 @@ CompleteIO(
|
|||
WaveHdr = (PWAVEHDR) SoundOverlapped->Header;
|
||||
SND_ASSERT( WaveHdr );
|
||||
|
||||
SND_ASSERT( ERROR_SUCCESS == dwErrorCode );
|
||||
|
||||
HdrExtension = (PWAVEHDR_EXTENSION) WaveHdr->reserved;
|
||||
SND_ASSERT( HdrExtension );
|
||||
|
||||
|
@ -305,6 +303,12 @@ StopStreamingInSoundThread(
|
|||
/* cancel all current audio buffers */
|
||||
FunctionTable->ResetStream(SoundDeviceInstance, DeviceType, TRUE);
|
||||
}
|
||||
while(SoundDeviceInstance->OutstandingBuffers)
|
||||
{
|
||||
SND_TRACE(L"StopStreamingInSoundThread OutStandingBufferCount %lu\n", SoundDeviceInstance->OutstandingBuffers);
|
||||
/* wait until pending i/o has completed */
|
||||
SleepEx(10, TRUE);
|
||||
}
|
||||
|
||||
/* complete all current headers */
|
||||
while( SoundDeviceInstance->HeadWaveHeader )
|
||||
|
@ -316,12 +320,6 @@ StopStreamingInSoundThread(
|
|||
/* there should be no oustanding buffers now */
|
||||
SND_ASSERT(SoundDeviceInstance->OutstandingBuffers == 0);
|
||||
|
||||
while(SoundDeviceInstance->OutstandingBuffers)
|
||||
{
|
||||
SND_ERR("StopStreamingInSoundThread OutStandingBufferCount %lu\n", SoundDeviceInstance->OutstandingBuffers);
|
||||
/* my hack of doom */
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
/* Check if reset function is supported */
|
||||
if (FunctionTable->ResetStream)
|
||||
|
|
Loading…
Reference in a new issue