aboutsummaryrefslogtreecommitdiff
path: root/graphics/video
diff options
context:
space:
mode:
authorSven Hesse2010-08-08 00:44:05 +0000
committerSven Hesse2010-08-08 00:44:05 +0000
commit2bcc02a27a5261fab4d769e3160ff490573a6be1 (patch)
tree71623b69493b196ae2007c927dfbccfab85daa5e /graphics/video
parent6e5518271b893b7b6fd81bc71f72bb40b660e059 (diff)
downloadscummvm-rg350-2bcc02a27a5261fab4d769e3160ff490573a6be1.tar.gz
scummvm-rg350-2bcc02a27a5261fab4d769e3160ff490573a6be1.tar.bz2
scummvm-rg350-2bcc02a27a5261fab4d769e3160ff490573a6be1.zip
VIDEO/GOB: Fixing the frame rate for mult'd videos.
In the gob engine, some videos are opened, and then played, at a later time, one frame at a time. In this case, we need to emulate the original's video player's behaviour, not calculating any "lag" for videos without sound. svn-id: r51870
Diffstat (limited to 'graphics/video')
-rw-r--r--graphics/video/coktel_decoder.cpp7
-rw-r--r--graphics/video/coktel_decoder.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp
index c8a934d5bb..73bcc6a8d0 100644
--- a/graphics/video/coktel_decoder.cpp
+++ b/graphics/video/coktel_decoder.cpp
@@ -439,6 +439,13 @@ Common::Rational CoktelDecoder::getFrameRate() const {
return _frameRate;
}
+uint32 CoktelDecoder::getTimeToNextFrame() const {
+ if (hasSound())
+ return FixedRateVideoDecoder::getTimeToNextFrame();
+
+ return (Common::Rational(1000) / _frameRate).toInt();
+}
+
inline void CoktelDecoder::unsignedToSigned(byte *buffer, int length) {
while (length-- > 0) *buffer++ ^= 0x80;
}
diff --git a/graphics/video/coktel_decoder.h b/graphics/video/coktel_decoder.h
index 0464b8e31b..9921fbd28c 100644
--- a/graphics/video/coktel_decoder.h
+++ b/graphics/video/coktel_decoder.h
@@ -174,6 +174,8 @@ protected:
public:
// FixedRateVideoDecoder interface
Common::Rational getFrameRate() const;
+
+ uint32 getTimeToNextFrame() const;
};
class PreIMDDecoder : public CoktelDecoder {