ao/wasapi: keep bufferPeriod in sync on retry

Without this, the retry will fail if they are not equal or
bufferPeriod is zero.
This commit is contained in:
Kevin Mitchell 2014-11-18 06:59:26 -08:00
parent 94ea4435a9
commit da03334a73
1 changed files with 4 additions and 1 deletions

View File

@ -489,9 +489,12 @@ reinit:
EXIT_ON_ERROR(hr);
}
IAudioClient_GetBufferSize(state->pAudioClient, &state->bufferFrameCount);
bufferDuration =
bufferPeriod = bufferDuration =
(REFERENCE_TIME)((10000.0 * 1000 / state->format.Format.nSamplesPerSec *
state->bufferFrameCount) + offset);
if (state->share_mode == AUDCLNT_SHAREMODE_SHARED)
bufferPeriod = 0;
offset += 0.5;
IAudioClient_Release(state->pAudioClient);
state->pAudioClient = NULL;