Quellcode durchsuchen

audio: Make SDL_GetAudioStreamProperties() thread safe.

Ryan C. Gordon vor 11 Monaten
Ursprung
Commit
8d3bec99a7
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      src/audio/SDL_audiocvt.c

+ 2 - 0
src/audio/SDL_audiocvt.c

@@ -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;
 }