diff options
author | Max Horn | 2010-03-10 21:01:44 +0000 |
---|---|---|
committer | Max Horn | 2010-03-10 21:01:44 +0000 |
commit | c97ee14a65afc0b8a11ef5c10105e966f67a5934 (patch) | |
tree | 0514519a8d07564c3f572689b5bd75ed99111dea /backends/platform/psp | |
parent | 5af51ba9a1f60f740401fdb513d1a961c590e527 (diff) | |
download | scummvm-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/psp')
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 19 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.h | 1 |
2 files changed, 9 insertions, 11 deletions
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index e29a9da763..50f233f752 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -90,8 +90,6 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0) _cursorPaletteDisabled = true; - _samplesPerSec = 0; - //init SDL uint32 sdlFlags = SDL_INIT_AUDIO | SDL_INIT_TIMER; SDL_Init(sdlFlags); @@ -951,27 +949,28 @@ void OSystem_PSP::mixCallback(void *sys, byte *samples, int len) { void OSystem_PSP::setupMixer(void) { SDL_AudioSpec desired; SDL_AudioSpec obtained; + uint32 samplesPerSec; memset(&desired, 0, sizeof(desired)); if (ConfMan.hasKey("output_rate")) - _samplesPerSec = ConfMan.getInt("output_rate"); + samplesPerSec = ConfMan.getInt("output_rate"); else - _samplesPerSec = SAMPLES_PER_SEC; + samplesPerSec = SAMPLES_PER_SEC; // Originally, we always used 2048 samples. This loop will produce the // same result at 22050 Hz, and should hopefully produce something // sensible for other frequencies. Note that it must be a power of two. - uint16 samples = 0x8000; + uint32 samples = 0x8000; for (;;) { - if (samples / (_samplesPerSec / 1000) < 100) + if (samples / (samplesPerSec / 1000) < 100) break; samples >>= 1; } - desired.freq = _samplesPerSec; + desired.freq = samplesPerSec; desired.format = AUDIO_S16SYS; desired.channels = 2; desired.samples = samples; @@ -984,16 +983,16 @@ void OSystem_PSP::setupMixer(void) { if (SDL_OpenAudio(&desired, &obtained) != 0) { warning("Could not open audio: %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; + samplesPerSec = obtained.freq; // Tell the mixer that we are ready and start the sound processing - _mixer->setOutputRate(_samplesPerSec); + _mixer->setOutputRate(samplesPerSec); _mixer->setReady(true); SDL_PauseAudio(0); diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 2d52ea2218..ed920e53c1 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -86,7 +86,6 @@ protected: uint32 _lastPadCheck; uint32 _padAccel; - uint32 _samplesPerSec; SceCtrlData pad; Common::SaveFileManager *_savefile; |