diff options
Diffstat (limited to 'backends/mixer/sdl/sdl-mixer.cpp')
-rw-r--r-- | backends/mixer/sdl/sdl-mixer.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index 3c79290b50..dc0c853808 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -33,9 +33,8 @@ #ifdef GP2X #define SAMPLES_PER_SEC 11025 #else -#define SAMPLES_PER_SEC 22050 +#define SAMPLES_PER_SEC 44100 #endif -//#define SAMPLES_PER_SEC 44100 SdlMixerManager::SdlMixerManager() : @@ -58,6 +57,16 @@ void SdlMixerManager::init() { error("Could not initialize SDL: %s", SDL_GetError()); } +#if SDL_VERSION_ATLEAST(2, 0, 0) + const char *sdlDriverName = SDL_GetCurrentAudioDriver(); +#else + const int maxNameLen = 20; + char sdlDriverName[maxNameLen]; + sdlDriverName[0] = '\0'; + SDL_AudioDriverName(sdlDriverName, maxNameLen); +#endif + debug(1, "Using SDL Audio Driver \"%s\"", sdlDriverName); + // Get the desired audio specs SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC); |