[Scummvm-cvs-logs] SF.net SVN: scummvm: [32839] scummvm/trunk/backends/platform/wince/ wince-sdl.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sun Jun 29 16:40:42 CEST 2008
Revision: 32839
http://scummvm.svn.sourceforge.net/scummvm/?rev=32839&view=rev
Author: knakos
Date: 2008-06-29 07:40:41 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
finish up new mixer changes
Modified Paths:
--------------
scummvm/trunk/backends/platform/wince/wince-sdl.cpp
Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp 2008-06-29 12:10:38 UTC (rev 32838)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp 2008-06-29 14:40:41 UTC (rev 32839)
@@ -94,7 +94,6 @@
// Static member inits
typedef void (*SoundProc)(void *param, byte *buf, int len);
bool OSystem_WINCE3::_soundMaster = true;
-SoundProc OSystem_WINCE3::_originalSoundProc = NULL;
bool _isSmartphone = false;
bool _hasSmartphoneResolution = false;
@@ -403,9 +402,8 @@
{
// Instantiate our own sound mixer
// mixer init is postponed until a game engine is selected.
- if (_mixer == 0) {
- _mixer = new Audio::Mixer(this);
- }
+ if (_mixer == 0)
+ _mixer = new Audio::MixerImpl(this);
// 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
@@ -770,7 +768,7 @@
_toolbarHandler.setVisible(false);
}
-void OSystem_WINCE3::setupMixer(SoundProc proc, void *param) {
+void OSystem_WINCE3::setupMixer() {
SDL_AudioSpec desired;
int thread_priority;
@@ -779,7 +777,6 @@
memset(&desired, 0, sizeof(desired));
- _originalSoundProc = proc;
desired.freq = _sampleRate;
desired.format = AUDIO_S16SYS;
desired.channels = 2;
@@ -788,9 +785,8 @@
desired.userdata = this;
// Create the mixer instance
- assert(!_mixer);
- _mixer = new Audio::MixerImpl(this);
- assert(_mixer);
+ if (_mixer == 0)
+ _mixer = new Audio::MixerImpl(this);
// Add sound thread priority
if (!ConfMan.hasKey("sound_thread_priority"))
@@ -808,7 +804,9 @@
} else {
debug(1, "Sound opened OK, mixing at %d Hz", _sampleRate);
- // Tell the mixer that we are ready and start the sound processing
+ // Re-create mixer to match the output rate
+ delete(_mixer);
+ _mixer = new Audio::MixerImpl(this);
_mixer->setOutputRate(_sampleRate);
_mixer->setReady(true);
SDL_PauseAudio(0);
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