aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorMax Horn2010-03-11 23:39:51 +0000
committerMax Horn2010-03-11 23:39:51 +0000
commit9b837d66d4647a7642a761cefe5798d30a21504a (patch)
treee5e96cd1a48850a699f0e77a748d415921f7b18e /backends/platform/sdl
parent5886a0cc7715c874919a7056dfb6b65d3be19dce (diff)
downloadscummvm-rg350-9b837d66d4647a7642a761cefe5798d30a21504a.tar.gz
scummvm-rg350-9b837d66d4647a7642a761cefe5798d30a21504a.tar.bz2
scummvm-rg350-9b837d66d4647a7642a761cefe5798d30a21504a.zip
Replace Audio::MixerImpl::setOutputRate with a new 'sampleRate' param to the MixerImpl constructor
svn-id: r48238
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/sdl.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index c5eb89ec8d..246327786d 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -715,7 +715,7 @@ void OSystem_SDL::setupMixer() {
samplesPerSec = SAMPLES_PER_SEC;
// Determine the sample buffer size. We want it to store enough data for
- // at least 1/16th of a second (though at maximum 8192 samples). Note
+ // at least 1/16th of a second (though at most 8192 samples). Note
// that it must be a power of two. So e.g. at 22050 Hz, we request a
// sample buffer size of 2048.
uint32 samples = 8192;
@@ -730,14 +730,11 @@ void OSystem_SDL::setupMixer() {
desired.callback = mixCallback;
desired.userdata = this;
- // Create the mixer instance
assert(!_mixer);
- _mixer = new Audio::MixerImpl(this);
- assert(_mixer);
-
if (SDL_OpenAudio(&desired, &_obtainedRate) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
- samplesPerSec = 0;
+ _mixer = new Audio::MixerImpl(this, samplesPerSec);
+ assert(_mixer);
_mixer->setReady(false);
} else {
// Note: This should be the obtained output rate, but it seems that at
@@ -746,8 +743,9 @@ void OSystem_SDL::setupMixer() {
samplesPerSec = _obtainedRate.freq;
debug(1, "Output sample rate: %d Hz", samplesPerSec);
- // Tell the mixer that we are ready and start the sound processing
- _mixer->setOutputRate(samplesPerSec);
+ // Create the mixer instance and start the sound processing
+ _mixer = new Audio::MixerImpl(this, samplesPerSec);
+ assert(_mixer);
_mixer->setReady(true);
#if MIXER_DOUBLE_BUFFERING