Skip to content

Commit

Permalink
Merge pull request #180 from Oldes/sokol-audio-fix
Browse files Browse the repository at this point in the history
FIX: warning: jump to label 'error' crosses initialization of 'REFERENCE_TIME dur'
  • Loading branch information
floooh authored Jul 8, 2019
2 parents 0d5734c + fac4b31 commit 5cf362a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sokol_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ _SOKOL_PRIVATE void _saudio_wasapi_release(void) {
}

_SOKOL_PRIVATE bool _saudio_backend_init(void) {
REFERENCE_TIME dur;
if (FAILED(CoInitializeEx(0, COINIT_MULTITHREADED))) {
SOKOL_LOG("sokol_audio wasapi: CoInitializeEx failed");
return false;
Expand Down Expand Up @@ -1157,7 +1158,7 @@ _SOKOL_PRIVATE bool _saudio_backend_init(void) {
fmt.wBitsPerSample = 16;
fmt.nBlockAlign = (fmt.nChannels * fmt.wBitsPerSample) / 8;
fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nBlockAlign;
REFERENCE_TIME dur = (REFERENCE_TIME)
dur = (REFERENCE_TIME)
(((double)_saudio.buffer_frames) / (((double)_saudio.sample_rate) * (1.0/10000000.0)));
if (FAILED(IAudioClient_Initialize(_saudio.backend.audio_client,
AUDCLNT_SHAREMODE_SHARED,
Expand Down

0 comments on commit 5cf362a

Please sign in to comment.