From be208264dd2025f0034d0848b21d2652b164f153 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 4 Sep 2017 12:03:34 -0400 Subject: VIDEO: Fix reverse playback right to the very start of the video --- video/avi_decoder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video') 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(_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); } -- cgit v1.2.3