aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/movie.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-10 14:40:59 -0400
committerPaul Gilbert2016-04-10 14:40:59 -0400
commit1ee3f334d39be6944e643c22cd376d5ae4ffaaf5 (patch)
treec41f2a1b5e5b0f340c47aa7dae0c34c6822d5209 /engines/titanic/support/movie.cpp
parent62b087adce4a0fdd0ff6a99ed5a9843ec0b722be (diff)
downloadscummvm-rg350-1ee3f334d39be6944e643c22cd376d5ae4ffaaf5.tar.gz
scummvm-rg350-1ee3f334d39be6944e643c22cd376d5ae4ffaaf5.tar.bz2
scummvm-rg350-1ee3f334d39be6944e643c22cd376d5ae4ffaaf5.zip
TITANIC: Change back to using original AVIDecoder
Diffstat (limited to 'engines/titanic/support/movie.cpp')
-rw-r--r--engines/titanic/support/movie.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 7593c74e42..6599093226 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -20,8 +20,7 @@
*
*/
-#include "image/codecs/cinepak.h"
-#include "titanic/support/avi_decoder.h"
+#include "video/avi_decoder.h"
#include "titanic/support/movie.h"
#include "titanic/titanic.h"
@@ -51,11 +50,18 @@ bool CMovie::get10() {
OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
_videoSurface(surface), _gameObject(nullptr) {
- _video = new AVIDecoder();
+ _video = new Video::AVIDecoder();
if (!_video->loadFile(name.getString()))
error("Could not open video - %s", name.getString().c_str());
}
+OSMovie::OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface) :
+ _videoSurface(surface), _gameObject(nullptr) {
+ _video = new Video::AVIDecoder();
+ if (!_video->loadStream(stream))
+ error("Could not parse movie stream");
+}
+
OSMovie::~OSMovie() {
g_vm->_activeMovies.remove(this);
delete _video;
@@ -134,7 +140,9 @@ MovieState OSMovie::getState() {
void OSMovie::update() {
if (_state != MOVIE_STOPPED) {
if (_video->isPlaying()) {
- if (_video->needsUpdate()) {
+ if (_video->endOfVideo()) {
+ _state = MOVIE_FINISHED;
+ } else if (_video->needsUpdate()) {
decodeFrame();
_state = MOVIE_FRAME;
} else {