mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 01:55:38 +00:00
wasapi: Clamp device->spec.samples to the hardware buffer size.
Reference Issue #8924.
This commit is contained in:
parent
5f6a4fe643
commit
ad1a11164c
|
@ -486,6 +486,11 @@ int WASAPI_PrepDevice(_THIS, const SDL_bool updatestream)
|
||||||
this->spec.samples = (Uint16)SDL_ceilf(period_frames);
|
this->spec.samples = (Uint16)SDL_ceilf(period_frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* regardless of what we calculated for the period size, clamp it to the expected hardware buffer size. */
|
||||||
|
if (this->spec.samples > bufsize) {
|
||||||
|
this->spec.samples = bufsize;
|
||||||
|
}
|
||||||
|
|
||||||
/* Update the fragment size as size in bytes */
|
/* Update the fragment size as size in bytes */
|
||||||
SDL_CalculateAudioSpec(&this->spec);
|
SDL_CalculateAudioSpec(&this->spec);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue