diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2014-11-18 06:59:26 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2014-11-18 06:59:26 -0800 |
commit | da03334a731ad25c0c048c0df7aa757e7dd2ecdd (patch) | |
tree | 61facc014a30052b129049de20e838021e1fba60 /audio | |
parent | 94ea4435a9a86876389c0816c9eaf8260a2931a5 (diff) |
ao/wasapi: keep bufferPeriod in sync on retry
Without this, the retry will fail if they are not equal or
bufferPeriod is zero.
Diffstat (limited to 'audio')
-rwxr-xr-x | audio/out/ao_wasapi_utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 3c78bb9b98..657a98aae3 100755 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -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; |