Skip to content

Commit

Permalink
Support SDL_AUDIODRIVER set to "dsound", which was used by SDL 1.2
Browse files Browse the repository at this point in the history
Fixes libsdl-org#5818
(cherry picked from commit abe38bc)
  • Loading branch information
slouken authored and sezero committed Jun 18, 2022
1 parent b1408d1 commit 1929ad1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/audio/SDL_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,15 @@ SDL_AudioInit(const char *driver_name)
const char *driver_attempt_end = SDL_strchr(driver_attempt, ',');
size_t driver_attempt_len = (driver_attempt_end != NULL) ? (driver_attempt_end - driver_attempt)
: SDL_strlen(driver_attempt);
#if SDL_AUDIO_DRIVER_DSOUND
/* SDL 1.2 uses the name "dsound", so we'll support both. */
if (driver_attempt_len == SDL_strlen("dsound") &&
(SDL_strncasecmp(driver_attempt, "dsound", driver_attempt_len) == 0)) {
driver_attempt = "directsound";
driver_attempt_len = SDL_strlen("directsound");
}
#endif

#if SDL_AUDIO_DRIVER_PULSEAUDIO
/* SDL 1.2 uses the name "pulse", so we'll support both. */
if (driver_attempt_len == SDL_strlen("pulse") &&
Expand Down

0 comments on commit 1929ad1

Please sign in to comment.