[Scummvm-cvs-logs] SF.net SVN: scummvm:[43643] scummvm/trunk/graphics/video/coktelvideo/ coktelvideo.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Aug 22 15:11:55 CEST 2009


Revision: 43643
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43643&view=rev
Author:   drmccoy
Date:     2009-08-22 13:11:55 +0000 (Sat, 22 Aug 2009)

Log Message:
-----------
Fixing some problems when calling the player with muted output

Modified Paths:
--------------
    scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp

Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp	2009-08-22 13:11:30 UTC (rev 43642)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp	2009-08-22 13:11:55 UTC (rev 43643)
@@ -362,6 +362,10 @@
 }
 
 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 @@
 }
 
 bool Imd::isSoundPlaying() const {
-	if (_audioStream && _mixer->isSoundHandleActive(_audioHandle))
+	if (_audioStream && _mixer && _mixer->isSoundHandleActive(_audioHandle))
 		return true;
 
 	return false;
@@ -1706,9 +1710,12 @@
 	}
 
 	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)) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list