[Scummvm-cvs-logs] SF.net SVN: scummvm:[55340] scummvm/trunk
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Thu Jan 20 04:22:43 CET 2011
Revision: 55340
http://scummvm.svn.sourceforge.net/scummvm/?rev=55340&view=rev
Author: drmccoy
Date: 2011-01-20 03:22:43 +0000 (Thu, 20 Jan 2011)
Log Message:
-----------
GOB: Make Urban Runner's "3D view" work again
Modified Paths:
--------------
scummvm/trunk/engines/gob/videoplayer.cpp
scummvm/trunk/engines/gob/videoplayer.h
scummvm/trunk/graphics/video/coktel_decoder.cpp
scummvm/trunk/graphics/video/coktel_decoder.h
Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp 2011-01-19 23:05:06 UTC (rev 55339)
+++ scummvm/trunk/engines/gob/videoplayer.cpp 2011-01-20 03:22:43 UTC (rev 55340)
@@ -246,6 +246,7 @@
video->live = true;
properties.waitEndFrame = false;
_liveProperties = properties;
+ updateLive(true);
return true;
}
@@ -279,26 +280,35 @@
if (!video)
return;
- if (!onlySound || video->decoder->hasSound())
- _vm->_util->delay(video->decoder->getTimeToNextFrame());
+ if (!onlySound || video->decoder->hasSound()) {
+ uint32 waitTime = video->decoder->getTimeToNextFrame();
+ if (!video->decoder->hasSound())
+ waitTime = video->decoder->getStaticTimeToNextFrame();;
+
+ _vm->_util->delay(waitTime);
+ }
}
-void VideoPlayer::updateLive() {
+void VideoPlayer::updateLive(bool force) {
Video *video = getVideoBySlot(0);
if (!video || !video->live)
return;
- if ((_liveProperties.startFrame == _liveProperties.lastFrame) ||
- (_liveProperties.startFrame >= (int32)(video->decoder->getFrameCount() - 1))) {
+ if (_liveProperties.startFrame >= (int32)(video->decoder->getFrameCount() - 1)) {
+ // Video ended
WRITE_VAR_OFFSET(212, (uint32)-1);
_vm->_vidPlayer->closeVideo();
return;
}
- if (video->decoder->getTimeToNextFrame() > 0)
+ if (_liveProperties.startFrame == _liveProperties.lastFrame)
+ // Current video sequence ended
return;
+ if (!force && (video->decoder->getTimeToNextFrame() > 0))
+ return;
+
WRITE_VAR_OFFSET(212, _liveProperties.startFrame + 1);
bool backwards = _liveProperties.startFrame > _liveProperties.lastFrame;
Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h 2011-01-19 23:05:06 UTC (rev 55339)
+++ scummvm/trunk/engines/gob/videoplayer.h 2011-01-20 03:22:43 UTC (rev 55340)
@@ -110,7 +110,7 @@
bool play(int slot, Properties &properties);
void waitEndFrame(int slot, bool onlySound = false);
- void updateLive();
+ void updateLive(bool force = false);
bool slotIsOpen(int slot = 0) const;
Modified: scummvm/trunk/graphics/video/coktel_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktel_decoder.cpp 2011-01-19 23:05:06 UTC (rev 55339)
+++ scummvm/trunk/graphics/video/coktel_decoder.cpp 2011-01-20 03:22:43 UTC (rev 55340)
@@ -606,21 +606,13 @@
}
uint32 CoktelDecoder::getTimeToNextFrame() const {
- // If there is no audio, just return the static time between
- // frames without any elaborate sync calculation. This is
- // needed for the gob engine, since it has a lot of control
- // between the videos and often plays just few frames out of
- // the middle of a long video.
-
- if (!hasSound())
- return (1000 / _frameRate).toInt();
-
- // If there /is/ audio, we do need to keep video and audio
- // in sync, though.
-
return FixedRateVideoDecoder::getTimeToNextFrame();
}
+uint32 CoktelDecoder::getStaticTimeToNextFrame() const {
+ return (1000 / _frameRate).toInt();
+}
+
inline void CoktelDecoder::unsignedToSigned(byte *buffer, int length) {
while (length-- > 0) *buffer++ ^= 0x80;
}
Modified: scummvm/trunk/graphics/video/coktel_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/coktel_decoder.h 2011-01-19 23:05:06 UTC (rev 55339)
+++ scummvm/trunk/graphics/video/coktel_decoder.h 2011-01-20 03:22:43 UTC (rev 55340)
@@ -131,6 +131,7 @@
const byte *getPalette();
bool hasDirtyPalette() const;
+ uint32 getStaticTimeToNextFrame() const;
// FixedRateVideoDecoder interface
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