wasapi: Patched to compile on C89 systems, and use SDL_ceilf instead of ceilf.
authorRyan C. Gordon
Tue, 07 Apr 2020 14:51:08 -0400
changeset 13707a4f83b2a4105
parent 13706 41280cc79f3d
child 13708 99bad97fec09
wasapi: Patched to compile on C89 systems, and use SDL_ceilf instead of ceilf.
src/audio/wasapi/SDL_wasapi.c
     1.1 --- a/src/audio/wasapi/SDL_wasapi.c	Tue Apr 07 14:37:24 2020 -0400
     1.2 +++ b/src/audio/wasapi/SDL_wasapi.c	Tue Apr 07 14:51:08 2020 -0400
     1.3 @@ -607,9 +607,11 @@
     1.4  
     1.5      /* Match the callback size to the period size to cut down on the number of
     1.6         interrupts waited for in each call to WaitDevice */
     1.7 -    float period_millis = default_period / 10000.0f;
     1.8 -    float period_frames = period_millis * this->spec.freq / 1000.0f;
     1.9 -    this->spec.samples = (Uint16)ceil(period_frames);
    1.10 +    {
    1.11 +        const float period_millis = default_period / 10000.0f;
    1.12 +        const float period_frames = period_millis * this->spec.freq / 1000.0f;
    1.13 +        this->spec.samples = (Uint16)SDL_ceilf(period_frames);
    1.14 +    }
    1.15  
    1.16      /* Update the fragment size as size in bytes */
    1.17      SDL_CalculateAudioSpec(&this->spec);