Skip to content

Commit

Permalink
ZVISION: Use videoDecoder.getTimeToNextFrame() to calculate the frame…
Browse files Browse the repository at this point in the history
… delay
  • Loading branch information
RichieSams committed Aug 5, 2013
1 parent cefb025 commit 3f5cf50
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions engines/zvision/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ void ZVision::playVideo(Video::VideoDecoder &videoDecoder) {

// Only continue while the video is still playing
while (videoDecoder.isPlaying()) {
_clock.update();
uint32 currentTime = _clock.getLastMeasuredTime();

// Check for engine quit and video stop key presses
while (_eventMan->pollEvent(_event)) {
switch (_event.type) {
Expand Down Expand Up @@ -133,11 +130,7 @@ void ZVision::playVideo(Video::VideoDecoder &videoDecoder) {
}
}

// Calculate the frame delay based off a desired frame time
int delay = _desiredFrameTime - (currentTime - _system->getMillis());
// Ensure non-negative
delay = delay < 0 ? 0 : delay;
_system->delayMillis(delay);
_system->delayMillis(videoDecoder.getTimeToNextFrame());
}

_clock.stop();
Expand Down

0 comments on commit 3f5cf50

Please sign in to comment.