mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
- Increase importance of the audio dpc which finishes irps
- Once one second of audio data has been buffered, always queue audio irps and dont complete them imediately. Greatly improves the playback of SMPlayer and probably many other audio players which act strictly on the timing of completed irps - Add debug traces when KsCreatePin fails svn path=/trunk/; revision=40649
This commit is contained in:
parent
3ec26577f7
commit
0050614d7f
3 changed files with 24 additions and 7 deletions
|
@ -30,6 +30,7 @@ typedef struct
|
|||
ULONG CurrentOffset;
|
||||
LONG NumMappings;
|
||||
ULONG NumDataAvailable;
|
||||
BOOL StartStream;
|
||||
KSPIN_CONNECT *ConnectDetails;
|
||||
PKSDATAFORMAT_WAVEFORMATEX DataFormat;
|
||||
|
||||
|
@ -159,6 +160,7 @@ IIrpQueue_fnAddMapping(
|
|||
Mapping->Header = (KSSTREAM_HEADER*)Buffer;
|
||||
Mapping->Irp = Irp;
|
||||
KeInitializeDpc(&Mapping->Dpc, DpcRoutine, (PVOID)Mapping);
|
||||
KeSetImportanceDpc(&Mapping->Dpc, HighImportance);
|
||||
|
||||
if (This->MaxFrameSize)
|
||||
{
|
||||
|
@ -258,8 +260,14 @@ IIrpQueue_fnMinimumDataAvailable(
|
|||
BOOL Result;
|
||||
IIrpQueueImpl * This = (IIrpQueueImpl*)iface;
|
||||
|
||||
if (This->StartStream)
|
||||
return TRUE;
|
||||
|
||||
if (This->DataFormat->WaveFormatEx.nAvgBytesPerSec < This->NumDataAvailable)
|
||||
{
|
||||
This->StartStream = TRUE;
|
||||
Result = TRUE;
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
|
||||
|
@ -282,6 +290,7 @@ IIrpQueue_fnUpdateFormat(
|
|||
{
|
||||
IIrpQueueImpl * This = (IIrpQueueImpl*)iface;
|
||||
This->DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)DataFormat;
|
||||
This->StartStream = FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -203,14 +203,17 @@ StopStreamWorkerRoutine(
|
|||
|
||||
This = (IPortPinWaveCyclicImpl*)Ctx->Pin;
|
||||
|
||||
IoFreeWorkItem(Ctx->WorkItem);
|
||||
FreeItem(Ctx, TAG_PORTCLASS);
|
||||
|
||||
if (This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue))
|
||||
return;
|
||||
|
||||
/* Set the state to stop */
|
||||
This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP);
|
||||
/* Set internal state to stop */
|
||||
This->State = KSSTATE_STOP;
|
||||
|
||||
IoFreeWorkItem(Ctx->WorkItem);
|
||||
FreeItem(Ctx, TAG_PORTCLASS);
|
||||
|
||||
DPRINT1("Stopping %p %u Irql %u\n", This, This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), KeGetCurrentIrql());
|
||||
}
|
||||
|
||||
|
|
|
@ -263,13 +263,18 @@ CreatePinWorkerRoutine(
|
|||
Status = KsCreatePin(WorkerContext->Entry->Handle, MixerPinConnect, GENERIC_READ | GENERIC_WRITE, &RealPinHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* This should not fail */
|
||||
DPRINT1("KsCreatePin failed with %x\n", Status);
|
||||
/* This should not fail */
|
||||
KeBugCheck(0);
|
||||
DPRINT1(" InputFormat: SampleRate %u Bits %u Channels %u\n", InputFormat->WaveFormatEx.nSamplesPerSec, InputFormat->WaveFormatEx.wBitsPerSample, InputFormat->WaveFormatEx.nChannels);
|
||||
DPRINT1("OutputFormat: SampleRate %u Bits %u Channels %u\n", OutputFormat->WaveFormatEx.nSamplesPerSec, OutputFormat->WaveFormatEx.wBitsPerSample, OutputFormat->WaveFormatEx.nChannels);
|
||||
|
||||
SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0);
|
||||
ExFreePool(WorkerContext->DispatchContext);
|
||||
ExFreePool(MixerPinConnect);
|
||||
IoFreeWorkItem(WorkerContext->WorkItem);
|
||||
ExFreePool(WorkerContext);
|
||||
return;
|
||||
}
|
||||
DPRINT(" InputFormat: SampleRate %u Bits %u Channels %u\n", InputFormat->WaveFormatEx.nSamplesPerSec, InputFormat->WaveFormatEx.wBitsPerSample, InputFormat->WaveFormatEx.nChannels);
|
||||
DPRINT("OutputFormat: SampleRate %u Bits %u Channels %u\n", OutputFormat->WaveFormatEx.nSamplesPerSec, OutputFormat->WaveFormatEx.wBitsPerSample, OutputFormat->WaveFormatEx.nChannels);
|
||||
}
|
||||
|
||||
/* get pin file object */
|
||||
|
|
Loading…
Reference in a new issue