aboutsummaryrefslogtreecommitdiff
path: root/video/psx_decoder.h
diff options
context:
space:
mode:
authorMatthew Hoops2012-01-10 22:15:04 -0500
committerWillem Jan Palenstijn2012-02-23 22:48:18 +0100
commit66cd8bdd68d9e0d14e40c9f55c06f8ea9cf2006b (patch)
tree37ee982ed7b485704bdfc0176d228bbeb5f522f1 /video/psx_decoder.h
parentee35d32a362d58891fedff9843867397f2d4497b (diff)
downloadscummvm-rg350-66cd8bdd68d9e0d14e40c9f55c06f8ea9cf2006b.tar.gz
scummvm-rg350-66cd8bdd68d9e0d14e40c9f55c06f8ea9cf2006b.tar.bz2
scummvm-rg350-66cd8bdd68d9e0d14e40c9f55c06f8ea9cf2006b.zip
VIDEO: Make PSX streams calculate frame timing solely from CD speed
BS2 videos now play at the proper rate and BS1 videos have improved a/v sync.
Diffstat (limited to 'video/psx_decoder.h')
-rw-r--r--video/psx_decoder.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/video/psx_decoder.h b/video/psx_decoder.h
index 4223f0344e..621870448b 100644
--- a/video/psx_decoder.h
+++ b/video/psx_decoder.h
@@ -53,18 +53,16 @@ namespace Video {
* - sword1 (psx)
* - sword2 (psx)
*/
-class PSXStreamDecoder : public FixedRateVideoDecoder {
+class PSXStreamDecoder : public VideoDecoder {
public:
// CD speed in sectors/second
// Calling code should use these enum values instead of the constants
enum CDSpeed {
- kCDUnk = 0,
kCD1x = 75,
kCD2x = 150
};
- PSXStreamDecoder(Common::Rational frameRate);
- PSXStreamDecoder(CDSpeed speed, uint32 frameCount);
+ PSXStreamDecoder(CDSpeed speed, uint32 frameCount = 0);
virtual ~PSXStreamDecoder();
bool loadStream(Common::SeekableReadStream *stream);
@@ -75,22 +73,18 @@ public:
uint16 getHeight() const { return _surface->h; }
uint32 getFrameCount() const { return _frameCount; }
uint32 getElapsedTime() const;
+ uint32 getTimeToNextFrame() const;
const Graphics::Surface *decodeNextFrame();
Graphics::PixelFormat getPixelFormat() const { return _surface->format; }
bool endOfVideo() const { return _stream->pos() >= _stream->size(); }
-protected:
- // Hardcoded frame rate
- Common::Rational getFrameRate() const { return _frameRate; }
-
private:
void initCommon();
Common::SeekableReadStream *_stream;
Graphics::Surface *_surface;
- CDSpeed _speed;
uint32 _frameCount;
- Common::Rational _frameRate;
+ Audio::Timestamp _nextFrameStartTime;
Audio::SoundHandle _audHandle;
Audio::QueuingAudioStream *_audStream;