audio: Don't use SDL_BindAudioStream inside SDL_OpenAudioDeviceStream().
It has a lot of complex validation and locking we want to avoid here.
This commit is contained in:
parent
5e6ae85b63
commit
5e1d9d19a4
1 changed files with 7 additions and 1 deletions
|
@ -1945,12 +1945,18 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au
|
||||||
stream = SDL_CreateAudioStream(spec, &device->spec);
|
stream = SDL_CreateAudioStream(spec, &device->spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stream || (SDL_BindAudioStream(logdevid, stream) == -1)) {
|
if (!stream) {
|
||||||
failed = SDL_TRUE;
|
failed = SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
// don't do all the complicated validation and locking of SDL_BindAudioStream just to set a few fields here.
|
||||||
|
logdev->bound_streams = stream;
|
||||||
logdev->simplified = SDL_TRUE; // forbid further binding changes on this logical device.
|
logdev->simplified = SDL_TRUE; // forbid further binding changes on this logical device.
|
||||||
|
|
||||||
|
stream->bound_device = logdev;
|
||||||
stream->simplified = SDL_TRUE; // so we know to close the audio device when this is destroyed.
|
stream->simplified = SDL_TRUE; // so we know to close the audio device when this is destroyed.
|
||||||
|
|
||||||
|
UpdateAudioStreamFormatsPhysical(device);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
int rc;
|
int rc;
|
||||||
if (iscapture) {
|
if (iscapture) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue