aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/animation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agos/animation.cpp')
-rw-r--r--engines/agos/animation.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 10f274b37f..cf12ee120a 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -268,6 +268,10 @@ void MoviePlayerDXA::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
uint w = getWidth();
const Graphics::Surface *surface = decodeNextFrame();
+
+ if (!surface)
+ return;
+
byte *src = (byte *)surface->pixels;
dst += y * pitch + x;
@@ -289,6 +293,8 @@ void MoviePlayerDXA::playVideo() {
_vm->clearSurfaces();
}
+ start();
+
while (!endOfVideo() && !_skipMovie && !_vm->shouldQuit())
handleNextFrame();
}
@@ -421,8 +427,6 @@ bool MoviePlayerSMK::load() {
if (!loadStream(videoStream))
error("Failed to load video stream from file %s", videoName.c_str());
- start();
-
debug(0, "Playing video %s", videoName.c_str());
CursorMan.showMouse(false);
@@ -435,6 +439,10 @@ void MoviePlayerSMK::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
uint w = getWidth();
const Graphics::Surface *surface = decodeNextFrame();
+
+ if (!surface)
+ return;
+
byte *src = (byte *)surface->pixels;
dst += y * pitch + x;
@@ -449,6 +457,8 @@ void MoviePlayerSMK::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
}
void MoviePlayerSMK::playVideo() {
+ start();
+
while (!endOfVideo() && !_skipMovie && !_vm->shouldQuit())
handleNextFrame();
}
@@ -491,7 +501,7 @@ bool MoviePlayerSMK::processFrame() {
uint32 waitTime = getTimeToNextFrame();
- if (!waitTime) {
+ if (!waitTime && !endOfVideoTracks()) {
warning("dropped frame %i", getCurFrame());
return false;
}