audio: Make SDL_GetAudioStreamProperties() thread safe.

This commit is contained in:
Ryan C. Gordon 2024-10-24 14:36:57 -04:00
parent 10e52e1899
commit 8d3bec99a7
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 2 additions and 0 deletions

View File

@ -442,9 +442,11 @@ SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream)
SDL_InvalidParamError("stream");
return 0;
}
SDL_LockMutex(stream->lock);
if (stream->props == 0) {
stream->props = SDL_CreateProperties();
}
SDL_UnlockMutex(stream->lock);
return stream->props;
}