diff options
author | Kostas Nakos | 2009-08-02 17:34:57 +0000 |
---|---|---|
committer | Kostas Nakos | 2009-08-02 17:34:57 +0000 |
commit | 5591bf368ca8a431a7a03272e0ec7330befbe8d8 (patch) | |
tree | 036edff225575332d6e5d48e3a08ae9b5bb96fc9 /backends/platform/wince | |
parent | b9263e172f8fe0aaca54d238818c6e01f00ddf17 (diff) | |
download | scummvm-rg350-5591bf368ca8a431a7a03272e0ec7330befbe8d8.tar.gz scummvm-rg350-5591bf368ca8a431a7a03272e0ec7330befbe8d8.tar.bz2 scummvm-rg350-5591bf368ca8a431a7a03272e0ec7330befbe8d8.zip |
rework mixer (re)init. fixes bug #2694722
svn-id: r43003
Diffstat (limited to 'backends/platform/wince')
-rw-r--r-- | backends/platform/wince/wince-sdl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 47d9597f4f..8343c84f28 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -403,9 +403,8 @@ static Uint32 timer_handler_wrapper(Uint32 interval) { void OSystem_WINCE3::initBackend() { // Instantiate our own sound mixer - // mixer init is postponed until a game engine is selected. - if (_mixer == 0) - _mixer = new Audio::MixerImpl(this); + // mixer init is rerun when a game engine is selected. + setupMixer(); // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer). // We work around this by using the SetTimer function, since we only use @@ -792,11 +791,15 @@ void OSystem_WINCE3::setupMixer() { SDL_AudioSpec desired; int thread_priority; + compute_sample_rate(); if (_sampleRate == 0) warning("setSoundCallback called with 0 _sampleRate. Audio will not work."); + else if (_mixer && _mixer->getOutputRate() == _sampleRate) { + debug(1, "Skipping sound mixer re-init: samplerate is good"); + return; + } memset(&desired, 0, sizeof(desired)); - desired.freq = _sampleRate; desired.format = AUDIO_S16SYS; desired.channels = 2; @@ -913,7 +916,6 @@ void OSystem_WINCE3::engineInit() { //update_game_settings(); // finalize mixer init - compute_sample_rate(); setupMixer(); } @@ -1085,8 +1087,6 @@ void OSystem_WINCE3::update_game_settings() { ConfMan.setBool("no_doubletap_rightclick", true); ConfMan.flushToDisk(); } - - compute_sample_rate(); } void OSystem_WINCE3::initSize(uint w, uint h) { |