aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/gp2x
diff options
context:
space:
mode:
authorMax Horn2010-03-10 21:01:44 +0000
committerMax Horn2010-03-10 21:01:44 +0000
commitc97ee14a65afc0b8a11ef5c10105e966f67a5934 (patch)
tree0514519a8d07564c3f572689b5bd75ed99111dea /backends/platform/gp2x
parent5af51ba9a1f60f740401fdb513d1a961c590e527 (diff)
downloadscummvm-rg350-c97ee14a65afc0b8a11ef5c10105e966f67a5934.tar.gz
scummvm-rg350-c97ee14a65afc0b8a11ef5c10105e966f67a5934.tar.bz2
scummvm-rg350-c97ee14a65afc0b8a11ef5c10105e966f67a5934.zip
Remove last traces of OSystem::getOutputSampleRate()
svn-id: r48229
Diffstat (limited to 'backends/platform/gp2x')
-rw-r--r--backends/platform/gp2x/gp2x-common.h3
-rw-r--r--backends/platform/gp2x/gp2x.cpp25
2 files changed, 12 insertions, 16 deletions
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h
index 6878673024..748d80ba1c 100644
--- a/backends/platform/gp2x/gp2x-common.h
+++ b/backends/platform/gp2x/gp2x-common.h
@@ -207,9 +207,6 @@ protected:
bool _overlayVisible;
Graphics::PixelFormat _overlayFormat;
- // Audio
- int _samplesPerSec;
-
// CD Audio
SDL_CD *_cdrom;
int _cdTrack, _cdNumLoops, _cdStartFrame, _cdDuration;
diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp
index e15281dbf4..139c64ed38 100644
--- a/backends/platform/gp2x/gp2x.cpp
+++ b/backends/platform/gp2x/gp2x.cpp
@@ -246,7 +246,6 @@ OSystem_GP2X::OSystem_GP2X()
_hwscreen(0), _screen(0), _tmpscreen(0),
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
- _samplesPerSec(0),
_cdrom(0), _scalerProc(0), _modeChanged(false), _screenChangeCount(0), _dirtyChecksums(0),
_mouseVisible(false), _mouseNeedsRedraw(false), _mouseData(0), _mouseSurface(0),
_mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true),
@@ -582,25 +581,25 @@ void OSystem_GP2X::setupMixer() {
SDL_AudioSpec obtained;
// Determine the desired output sampling frequency.
- _samplesPerSec = 0;
+ uint32 samplesPerSec = 0;
if (ConfMan.hasKey("output_rate"))
- _samplesPerSec = ConfMan.getInt("output_rate");
- if (_samplesPerSec <= 0)
- _samplesPerSec = SAMPLES_PER_SEC;
+ samplesPerSec = ConfMan.getInt("output_rate");
+ if (samplesPerSec <= 0)
+ samplesPerSec = SAMPLES_PER_SEC;
//Quick EVIL Hack - DJWillis
-// _samplesPerSec = 11025;
+// samplesPerSec = 11025;
// Determine the sample buffer size. We want it to store enough data for
// about 1/16th of a second. Note that it must be a power of two.
// So e.g. at 22050 Hz, we request a sample buffer size of 2048.
- int samples = 8192;
- while (16 * samples >= _samplesPerSec) {
+ uint32 samples = 8192;
+ while (16 * samples >= samplesPerSec) {
samples >>= 1;
}
memset(&desired, 0, sizeof(desired));
- desired.freq = _samplesPerSec;
+ desired.freq = samplesPerSec;
desired.format = AUDIO_S16SYS;
desired.channels = 2;
//desired.samples = (uint16)samples;
@@ -615,17 +614,17 @@ void OSystem_GP2X::setupMixer() {
if (SDL_OpenAudio(&desired, &obtained) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
- _samplesPerSec = 0;
+ samplesPerSec = 0;
_mixer->setReady(false);
} else {
// Note: This should be the obtained output rate, but it seems that at
// least on some platforms SDL will lie and claim it did get the rate
// even if it didn't. Probably only happens for "weird" rates, though.
- _samplesPerSec = obtained.freq;
- debug(1, "Output sample rate: %d Hz", _samplesPerSec);
+ samplesPerSec = obtained.freq;
+ debug(1, "Output sample rate: %d Hz", samplesPerSec);
// Tell the mixer that we are ready and start the sound processing
- _mixer->setOutputRate(_samplesPerSec);
+ _mixer->setOutputRate(samplesPerSec);
_mixer->setReady(true);
#ifdef MIXER_DOUBLE_BUFFERING