diff options
author | Sven Hesse | 2009-08-22 13:11:55 +0000 |
---|---|---|
committer | Sven Hesse | 2009-08-22 13:11:55 +0000 |
commit | e673bd5b95a9e51af2ad94ca0dc607651f53fa9d (patch) | |
tree | b4958713d84490939fc2c8bbcde5b34aae19aad1 /graphics/video | |
parent | 401e54825f986b8287acd3f9b2d8002327ccef27 (diff) | |
download | scummvm-rg350-e673bd5b95a9e51af2ad94ca0dc607651f53fa9d.tar.gz scummvm-rg350-e673bd5b95a9e51af2ad94ca0dc607651f53fa9d.tar.bz2 scummvm-rg350-e673bd5b95a9e51af2ad94ca0dc607651f53fa9d.zip |
Fixing some problems when calling the player with muted output
svn-id: r43643
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp index 39aeca07bd..b69315cbae 100644 --- a/graphics/video/coktelvideo/coktelvideo.cpp +++ b/graphics/video/coktelvideo/coktelvideo.cpp @@ -362,6 +362,10 @@ void Imd::setDoubleMode(bool doubleMode) { } void Imd::enableSound(Audio::Mixer &mixer) { + // Sanity check + if (mixer.getOutputRate() == 0) + return; + // Only possible on the first frame if (_curFrame > 0) return; @@ -387,7 +391,7 @@ void Imd::disableSound() { } bool Imd::isSoundPlaying() const { - if (_audioStream && _mixer->isSoundHandleActive(_audioHandle)) + if (_audioStream && _mixer && _mixer->isSoundHandleActive(_audioHandle)) return true; return false; @@ -1706,9 +1710,12 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) { } if (startSound && _soundEnabled) { - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream); - _skipFrames = 0; - _soundStage = 2; + if (_hasSound && _audioStream) { + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream); + _skipFrames = 0; + _soundStage = 2; + } else + _soundStage = 0; } if ((_curFrame == (_framesCount - 1)) && (_soundStage == 2)) { |