diff options
author | Matthew Hoops | 2011-05-16 22:47:41 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-18 10:05:13 -0400 |
commit | f559741bfc0024b772724201b7e764441fee13c2 (patch) | |
tree | 540fbe7287e110d14dc76ca71bb021e2358ff3d6 /engines/sword25/fmv/theora_decoder.h | |
parent | 5813ac1bcf57f592472c9d095c26781cd8b47a05 (diff) | |
download | scummvm-rg350-f559741bfc0024b772724201b7e764441fee13c2.tar.gz scummvm-rg350-f559741bfc0024b772724201b7e764441fee13c2.tar.bz2 scummvm-rg350-f559741bfc0024b772724201b7e764441fee13c2.zip |
SWORD25: Fix a/v sync with using the TheoraDecoder standalone
Hopefully should fix a/v sync from in-game. If not, the engine needs to be changed slightly
Diffstat (limited to 'engines/sword25/fmv/theora_decoder.h')
-rw-r--r-- | engines/sword25/fmv/theora_decoder.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h index a1ce3ae473..4a646f19ce 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -41,8 +41,6 @@ namespace Common { class SeekableReadStream; } -//#define ENABLE_THEORA_SEEKING // enables the extra calculations used for video seeking - namespace Sword25 { /** @@ -51,7 +49,7 @@ namespace Sword25 { * Video decoder used in engines: * - sword25 */ -class TheoraDecoder : public Video::FixedRateVideoDecoder { +class TheoraDecoder : public Video::VideoDecoder { public: TheoraDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); virtual ~TheoraDecoder(); @@ -83,16 +81,14 @@ public: } Graphics::PixelFormat getPixelFormat() const { return _surface->format; } - uint32 getElapsedTime() const; + uint32 getTimeToNextFrame() const; bool endOfVideo() const; -protected: - Common::Rational getFrameRate() const { return _frameRate; } - private: void queuePage(ogg_page *page); + bool queueAudio(); int bufferData(); void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer); @@ -100,7 +96,9 @@ private: Common::SeekableReadStream *_fileStream; Graphics::Surface *_surface; Common::Rational _frameRate; - uint32 _frameCount; + double _nextFrameStartTime; + bool _endOfVideo; + bool _endOfAudio; Audio::Mixer::SoundType _soundType; Audio::SoundHandle *_audHandle; @@ -131,12 +129,6 @@ private: int _audiobufFill; bool _audiobufReady; ogg_int16_t *_audiobuf; - -#if ENABLE_THEORA_SEEKING - double _videobufTime; - ogg_int64_t _videobufGranulePos; - ogg_int64_t _audiobufGranulePos; // time position of last sample -#endif }; } // End of namespace Sword25 |