[Scummvm-cvs-logs] SF.net SVN: scummvm:[43004] scummvm/branches/branch-1-0-0/backends/platform /wince/wince-sdl.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sun Aug 2 19:35:34 CEST 2009
Revision: 43004
http://scummvm.svn.sourceforge.net/scummvm/?rev=43004&view=rev
Author: knakos
Date: 2009-08-02 17:35:34 +0000 (Sun, 02 Aug 2009)
Log Message:
-----------
rework mixer (re)init. fixes bug #2694722 (backport)
Modified Paths:
--------------
scummvm/branches/branch-1-0-0/backends/platform/wince/wince-sdl.cpp
Modified: scummvm/branches/branch-1-0-0/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/backends/platform/wince/wince-sdl.cpp 2009-08-02 17:34:57 UTC (rev 43003)
+++ scummvm/branches/branch-1-0-0/backends/platform/wince/wince-sdl.cpp 2009-08-02 17:35:34 UTC (rev 43004)
@@ -403,9 +403,8 @@
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 @@
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 @@
//update_game_settings();
// finalize mixer init
- compute_sample_rate();
setupMixer();
}
@@ -1085,8 +1087,6 @@
ConfMan.setBool("no_doubletap_rightclick", true);
ConfMan.flushToDisk();
}
-
- compute_sample_rate();
}
void OSystem_WINCE3::initSize(uint w, uint h) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list