diff options
author | Max Horn | 2007-02-25 00:12:11 +0000 |
---|---|---|
committer | Max Horn | 2007-02-25 00:12:11 +0000 |
commit | 497f7683ca4b5bddf7c1150ac69cc39b0657f476 (patch) | |
tree | 81c1b209273b098e8ca26e74b2d689bc5ab20c24 /engines/scumm/smush | |
parent | dd26444b72767e58b0a7b0c5c6c677af5377792f (diff) | |
download | scummvm-rg350-497f7683ca4b5bddf7c1150ac69cc39b0657f476.tar.gz scummvm-rg350-497f7683ca4b5bddf7c1150ac69cc39b0657f476.tar.bz2 scummvm-rg350-497f7683ca4b5bddf7c1150ac69cc39b0657f476.zip |
Another Ogg > MP3 consistency reordering, this time in the SMUSH code; also changed it to use the new compressed audio stream factories
svn-id: r25843
Diffstat (limited to 'engines/scumm/smush')
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 28 | ||||
-rw-r--r-- | engines/scumm/smush/smush_player.h | 1 |
2 files changed, 12 insertions, 17 deletions
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 0cd4bfcc6c..d4b3352be4 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -1180,10 +1180,8 @@ void SmushPlayer::seekSan(const char *file, int32 pos, int32 contFrame) { } void SmushPlayer::tryCmpFile(const char *filename) { - if (_compressedFile.isOpen()) { - _vm->_mixer->stopHandle(_compressedFileSoundHandle); - _compressedFile.close(); - } + _vm->_mixer->stopHandle(_compressedFileSoundHandle); + _compressedFileMode = false; const char *i = strrchr(filename, '.'); if (i == NULL) { @@ -1192,28 +1190,26 @@ void SmushPlayer::tryCmpFile(const char *filename) { #if defined(USE_MAD) || defined(USE_VORBIS) char fname[260]; #endif -#ifdef USE_MAD + Common::File *file = new Common::File(); +#ifdef USE_VORBIS memcpy(fname, filename, i - filename); - strcpy(fname + (i - filename), ".mp3"); - _compressedFile.open(fname); - if (_compressedFile.isOpen()) { - int size = _compressedFile.size(); + strcpy(fname + (i - filename), ".ogg"); + if (file->open(fname)) { _compressedFileMode = true; - _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeMP3Stream(&_compressedFile, size)); + _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeVorbisStream(file, true, 0, 0)); return; } #endif -#ifdef USE_VORBIS +#ifdef USE_MAD memcpy(fname, filename, i - filename); - strcpy(fname + (i - filename), ".ogg"); - _compressedFile.open(fname); - if (_compressedFile.isOpen()) { - int size = _compressedFile.size(); + strcpy(fname + (i - filename), ".mp3"); + if (file->open(fname)) { _compressedFileMode = true; - _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeVorbisStream(&_compressedFile, size)); + _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeMP3Stream(file, true, 0, 0)); return; } #endif + delete file; } void SmushPlayer::pause() { diff --git a/engines/scumm/smush/smush_player.h b/engines/scumm/smush/smush_player.h index 64240e5216..6b09729318 100644 --- a/engines/scumm/smush/smush_player.h +++ b/engines/scumm/smush/smush_player.h @@ -66,7 +66,6 @@ private: Audio::SoundHandle _compressedFileSoundHandle; bool _compressedFileMode; - Common::File _compressedFile; byte _IACToutput[4096]; int32 _IACTpos; bool _storeFrame; |