aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-04 12:03:34 -0400
committerPaul Gilbert2017-09-04 12:03:34 -0400
commitbe208264dd2025f0034d0848b21d2652b164f153 (patch)
tree7f30b6a002692f62f96723d516302a820b5b7fec /video
parent0b19ebe7b239a8e685832c0a5c316e75cd4c557b (diff)
downloadscummvm-rg350-be208264dd2025f0034d0848b21d2652b164f153.tar.gz
scummvm-rg350-be208264dd2025f0034d0848b21d2652b164f153.tar.bz2
scummvm-rg350-be208264dd2025f0034d0848b21d2652b164f153.zip
VIDEO: Fix reverse playback right to the very start of the video
Diffstat (limited to 'video')
-rw-r--r--video/avi_decoder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index ea10b95f5a..7d182935c1 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -132,7 +132,7 @@ bool AVIDecoder::isSeekable() const {
const Graphics::Surface *AVIDecoder::decodeNextFrame() {
AVIVideoTrack *track = nullptr;
bool isReversed = false;
- int frameNum;
+ int frameNum = 0;
// Check whether the video is playing in revese
for (int idx = _videoTracks.size() - 1; idx >= 0; --idx) {
@@ -155,6 +155,7 @@ const Graphics::Surface *AVIDecoder::decodeNextFrame() {
for (int idx = _videoTracks.size() - 1; idx >= 0; --idx) {
track = static_cast<AVIVideoTrack *>(_videoTracks[idx].track);
track->setCurFrame(frameNum - 1);
+ findNextVideoTrack();
}
}
@@ -1020,7 +1021,7 @@ bool AVIDecoder::AVIVideoTrack::setReverse(bool reverse) {
bool AVIDecoder::AVIVideoTrack::endOfTrack() const {
if (_reversed)
- return _curFrame < 0;
+ return _curFrame < -1;
return _curFrame >= (getFrameCount() - 1);
}