[Scummvm-cvs-logs] SF.net SVN: scummvm:[55503] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Mon Jan 24 15:10:15 CET 2011


Revision: 55503
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55503&view=rev
Author:   drmccoy
Date:     2011-01-24 14:10:15 +0000 (Mon, 24 Jan 2011)

Log Message:
-----------
GOB: Wait for the exact moment of the video sound's end

This should fix all cut-off sound issues in Urban Runner

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter_v6.cpp
    scummvm/trunk/engines/gob/videoplayer.cpp
    scummvm/trunk/engines/gob/videoplayer.h

Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp	2011-01-24 14:09:47 UTC (rev 55502)
+++ scummvm/trunk/engines/gob/inter_v6.cpp	2011-01-24 14:10:15 UTC (rev 55503)
@@ -190,9 +190,8 @@
 		_vm->_vidPlayer->play(slot, props);
 
 	if (close && !props.noBlock) {
-		if (props.hasSound && !props.canceled)
-			_vm->_util->longDelay(500);
-
+		if (!props.canceled)
+			_vm->_vidPlayer->waitSoundEnd(slot);
 		_vm->_vidPlayer->closeVideo(slot);
 	}
 

Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp	2011-01-24 14:09:47 UTC (rev 55502)
+++ scummvm/trunk/engines/gob/videoplayer.cpp	2011-01-24 14:10:15 UTC (rev 55503)
@@ -251,6 +251,25 @@
 		pauseVideo(i, pause);
 }
 
+void VideoPlayer::finishVideoSound(int slot) {
+	Video *video = getVideoBySlot(slot);
+	if (!video || !video->decoder)
+		return;
+
+	video->decoder->finishSound();
+}
+
+void VideoPlayer::waitSoundEnd(int slot) {
+	Video *video = getVideoBySlot(slot);
+	if (!video || !video->decoder)
+		return;
+
+	video->decoder->finishSound();
+
+	while(video->decoder->isSoundPlaying())
+		_vm->_util->longDelay(1);
+}
+
 bool VideoPlayer::play(int slot, Properties &properties) {
 	Video *video = getVideoBySlot(slot);
 	if (!video)

Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h	2011-01-24 14:09:47 UTC (rev 55502)
+++ scummvm/trunk/engines/gob/videoplayer.h	2011-01-24 14:10:15 UTC (rev 55503)
@@ -116,6 +116,9 @@
 	void pauseVideo(int slot, bool pause);
 	void pauseAll(bool pause);
 
+	void finishVideoSound(int slot);
+	void waitSoundEnd(int slot);
+
 	bool play(int slot, Properties &properties);
 	void waitEndFrame(int slot, bool onlySound = false);
 


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