diff options
author | Einar Johan Trøan Sømåen | 2012-10-23 02:34:27 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-10-23 02:34:27 +0200 |
commit | 4aa1c63eb13f7f96f273b19842d73f88e4719f90 (patch) | |
tree | 20fc103abb5d8e63724cb03203de8cb232cae605 /engines | |
parent | b52274d011bb0e4be399dd25a04f76f6a3c22f8c (diff) | |
download | scummvm-rg350-4aa1c63eb13f7f96f273b19842d73f88e4719f90.tar.gz scummvm-rg350-4aa1c63eb13f7f96f273b19842d73f88e4719f90.tar.bz2 scummvm-rg350-4aa1c63eb13f7f96f273b19842d73f88e4719f90.zip |
WINTERMUTE: Add a hack to allow videos to loop
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/video/video_theora_player.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 0f8bc018ea..d14c807e11 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -151,7 +151,32 @@ bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common: ////////////////////////////////////////////////////////////////////////// bool VideoTheoraPlayer::resetStream() { - warning("VidTheoraPlayer::resetStream - stubbed"); + warning("VidTheoraPlayer::resetStream - hacked"); + // HACK: Just reopen the same file again. + if (_theoraDecoder) { + _theoraDecoder->close(); + } + delete _theoraDecoder; + _theoraDecoder = NULL; + + _file = BaseFileManager::getEngineInstance()->openFile(_filename, true, false); + if (!_file) { + return STATUS_FAILED; + } + +#if defined (USE_THEORADEC) + _theoraDecoder = new Video::TheoraDecoder(); +#else + return STATUS_FAILED; +#endif + _theoraDecoder->loadStream(_file); + + if (!_theoraDecoder->isVideoLoaded()) { + return STATUS_FAILED; + } + + return play(_playbackType, _posX, _posY, false, false, _looping, 0, _playZoom); + // End of hack. #if 0 // Stubbed for now, as theora isn't seekable if (_sound) { _sound->Stop(); @@ -265,8 +290,10 @@ bool VideoTheoraPlayer::update() { if (_theoraDecoder) { if (_theoraDecoder->endOfVideo() && _looping) { - warning("Should loop movie %s", _filename.c_str()); + warning("Should loop movie %s, hacked for now", _filename.c_str()); _theoraDecoder->rewind(); + //HACK: Just reinitialize the same video again: + return resetStream(); } else if (_theoraDecoder->endOfVideo() && !_looping) { debugC(kWintermuteDebugLog, "Finished movie %s", _filename.c_str()); _state = THEORA_STATE_FINISHED; |