wasapi: fixed the bug when on stream stop/start/stop/start sequence callback could be called with number of samples smaller than requested by user in Pa_OpenStream

This commit is contained in:
dmitrykos 2011-02-21 22:41:06 +00:00
commit 3fb0ef9e30

View file

@ -4733,16 +4733,25 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
if (stream->bufferMode == paUtilFixedHostBufferSize)
{
if (frames >= stream->out.framesPerBuffer)
{
frames = stream->out.framesPerBuffer;
}
if (frames != 0)
{
if ((hr = ProcessOutputBuffer(stream, processor, frames)) != S_OK)
{
LogHostError(hr); // not fatal, just log
}
}
if ((hr = ProcessOutputBuffer(stream, processor, frames)) != S_OK)
{
LogHostError(hr); // not fatal, just log
}
}
}
else
{
if (frames != 0)
{
if ((hr = ProcessOutputBuffer(stream, processor, frames)) != S_OK)
{
LogHostError(hr); // not fatal, just log
}
}
}
}
else
{