Skip to content

Commit

Permalink
wasapi: Patched to compile on C89 systems, and use SDL_ceilf instead …
Browse files Browse the repository at this point in the history
…of ceilf.
  • Loading branch information
icculus committed Apr 7, 2020
1 parent 4c2be47 commit fba081e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/audio/wasapi/SDL_wasapi.c
Expand Up @@ -607,9 +607,11 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream)

/* Match the callback size to the period size to cut down on the number of
interrupts waited for in each call to WaitDevice */
float period_millis = default_period / 10000.0f;
float period_frames = period_millis * this->spec.freq / 1000.0f;
this->spec.samples = (Uint16)ceil(period_frames);
{
const float period_millis = default_period / 10000.0f;
const float period_frames = period_millis * this->spec.freq / 1000.0f;
this->spec.samples = (Uint16)SDL_ceilf(period_frames);
}

/* Update the fragment size as size in bytes */
SDL_CalculateAudioSpec(&this->spec);
Expand Down

0 comments on commit fba081e

Please sign in to comment.