瀏覽代碼

Support the "ambient" value for SDL_HINT_AUDIO_CATEGORY

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

(cherry picked from commit 4725213eeff211267fa9c8f71bee1baad406f590)
Sam Lantinga 1 月之前
父節點
當前提交
40371f0907
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/audio/coreaudio/SDL_coreaudio.m

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

@@ -420,7 +420,8 @@ static bool UpdateAudioSession(SDL_AudioDevice *device, bool open, bool allow_pl
 
         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;