[Scummvm-cvs-logs] SF.net SVN: scummvm:[53938] scummvm/trunk/engines/sword25/fmv/ theora_decoder.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sat Oct 30 10:21:11 CEST 2010


Revision: 53938
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53938&view=rev
Author:   eriktorbjorn
Date:     2010-10-30 08:21:10 +0000 (Sat, 30 Oct 2010)

Log Message:
-----------
SWORD25: Fix hanging cutscene video

Even though our video player does not (yet) support audio, we need to
adjust the values of _audiobufFill and _audiobufReady as if it did, or
it will never realize it has reached the end of the cutscene.

Also fixes what looks like a typo in audio data clipping.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp

Modified: scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp	2010-10-30 04:30:42 UTC (rev 53937)
+++ scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp	2010-10-30 08:21:10 UTC (rev 53938)
@@ -345,7 +345,7 @@
 			int maxsamples = (AUDIOFD_FRAGSIZE - _audiobufFill) / 2 / _vorbisInfo.channels;
 			for (i = 0; i < ret && i < maxsamples; i++)
 				for (j = 0; j < _vorbisInfo.channels; j++) {
-					int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32768);
+					int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32767);
 					_audiobuf[count++] = val;
 				}
 
@@ -411,12 +411,15 @@
 	}
 
 	// If playback has begun, top audio buffer off immediately.
+	if (_stateFlag && _audiobufReady) {
 /* FIXME: This is currently crashing
-	if (_stateFlag) {
 		_audStream->queueBuffer((byte *)_audiobuf, AUDIOFD_FRAGSIZE, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO);
-	}
 */
 
+		_audiobufFill = 0;
+		_audiobufReady = false;
+	}
+
 	// are we at or past time for this video frame?
 	if (_stateFlag && _videobufReady) {
 		th_ycbcr_buffer yuv;


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