diff options
-rw-r--r-- | engines/wintermute/video/VidTheoraPlayer.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/video/VidTheoraPlayer.h | 2 | ||||
-rw-r--r-- | engines/wintermute/video/decoders/theora_decoder.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/video/decoders/theora_decoder.h | 4 |
4 files changed, 14 insertions, 4 deletions
diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp index 3171e6881f..fd1b7cea2b 100644 --- a/engines/wintermute/video/VidTheoraPlayer.cpp +++ b/engines/wintermute/video/VidTheoraPlayer.cpp @@ -448,6 +448,7 @@ HRESULT CVidTheoraPlayer::update() { if (_theoraDecoder) { if (_theoraDecoder->endOfVideo() && _looping) { warning("Should loop movie"); + _theoraDecoder->rewind(); } else if (_theoraDecoder->endOfVideo() && !_looping) { warning("Finished movie"); _state = THEORA_STATE_FINISHED; @@ -576,7 +577,11 @@ int CVidTheoraPlayer::getMovieFrame() { return Time / ((double)m_TheoraInfo.fps_denominator / m_TheoraInfo.fps_numerator); #endif - return 0; + if (_theoraDecoder) { + return _theoraDecoder->getTime(); + } else { + return 0; + } } ////////////////////////////////////////////////////////////////////////// @@ -593,7 +598,6 @@ HRESULT CVidTheoraPlayer::WriteVideo() { ////////////////////////////////////////////////////////////////////////// HRESULT CVidTheoraPlayer::display(uint32 Alpha) { - RECT rc; HRESULT Res; diff --git a/engines/wintermute/video/VidTheoraPlayer.h b/engines/wintermute/video/VidTheoraPlayer.h index 0ce6e42b5a..50a94667fd 100644 --- a/engines/wintermute/video/VidTheoraPlayer.h +++ b/engines/wintermute/video/VidTheoraPlayer.h @@ -38,7 +38,7 @@ private: THEORA_STATE_PAUSED = 2, THEORA_STATE_FINISHED = 3 }; - Video::VideoDecoder *_theoraDecoder; + Video::RewindableVideoDecoder *_theoraDecoder; Graphics::Surface _surface; public: //DECLARE_PERSISTENT(CVidTheoraPlayer, CBBase); diff --git a/engines/wintermute/video/decoders/theora_decoder.cpp b/engines/wintermute/video/decoders/theora_decoder.cpp index 7c766fe3c6..647d9aff08 100644 --- a/engines/wintermute/video/decoders/theora_decoder.cpp +++ b/engines/wintermute/video/decoders/theora_decoder.cpp @@ -561,6 +561,10 @@ void TheoraDecoder::updateBalance() { g_system->getMixer()->setChannelBalance(*_audHandle, getBalance()); } +void TheoraDecoder::rewind() { + reset(); +} + } // End of namespace Sword25 #endif diff --git a/engines/wintermute/video/decoders/theora_decoder.h b/engines/wintermute/video/decoders/theora_decoder.h index 79e669c068..3844434036 100644 --- a/engines/wintermute/video/decoders/theora_decoder.h +++ b/engines/wintermute/video/decoders/theora_decoder.h @@ -50,7 +50,7 @@ namespace WinterMute { * - sword25 * - wintermute */ -class TheoraDecoder : public Video::VideoDecoder { +class TheoraDecoder : public Video::RewindableVideoDecoder { public: TheoraDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); virtual ~TheoraDecoder(); @@ -87,6 +87,8 @@ public: bool endOfVideo() const; + void rewind(); + protected: // VideoDecoder API void updateVolume(); |