Переглянути джерело

Support the "ambient" value for SDL_HINT_AUDIO_CATEGORY

Fixes https://github.com/libsdl-org/SDL/issues/13732

(cherry picked from commit 4725213eeff211267fa9c8f71bee1baad406f590)
(cherry picked from commit 5e85a29e754a10ea1c5f143e3906698b1f23d646)
Sam Lantinga 3 тижнів тому
батько
коміт
54772f345a
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      src/audio/coreaudio/SDL_coreaudio.m

+ 2 - 1
src/audio/coreaudio/SDL_coreaudio.m

@@ -383,7 +383,8 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec
 
         hint = SDL_GetHint(SDL_HINT_AUDIO_CATEGORY);
         if (hint) {
-            if (SDL_strcasecmp(hint, "AVAudioSessionCategoryAmbient") == 0) {
+            if (SDL_strcasecmp(hint, "AVAudioSessionCategoryAmbient") == 0 ||
+                SDL_strcasecmp(hint, "ambient") == 0) {
                 category = AVAudioSessionCategoryAmbient;
             } else if (SDL_strcasecmp(hint, "AVAudioSessionCategorySoloAmbient") == 0) {
                 category = AVAudioSessionCategorySoloAmbient;