mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
GRIM/SMUSH: Fix drawing the last frame for the correct duration.
This commit is contained in:
parent
39b0a7cf85
commit
65052f9da4
@ -221,6 +221,11 @@ bool SmushDecoder::loadStream(Common::SeekableReadStream *stream) {
|
||||
|
||||
const Graphics::Surface *SmushDecoder::decodeNextFrame() {
|
||||
handleFrame();
|
||||
|
||||
// We might be interested in getting the last frame even after the video ends:
|
||||
if (endOfVideo()) {
|
||||
return _videoTrack->decodeNextFrame();
|
||||
}
|
||||
return VideoDecoder::decodeNextFrame();
|
||||
}
|
||||
|
||||
|
@ -86,8 +86,9 @@ bool MoviePlayer::prepareFrame() {
|
||||
_videoFinished = true;
|
||||
}
|
||||
|
||||
if (_videoPause)
|
||||
if (_videoPause) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_videoFinished) {
|
||||
if (g_grim->getMode() == GrimEngine::SmushMode) {
|
||||
@ -101,9 +102,10 @@ bool MoviePlayer::prepareFrame() {
|
||||
return false;
|
||||
|
||||
handleFrame();
|
||||
|
||||
_internalSurface = _videoDecoder->decodeNextFrame();
|
||||
_updateNeeded = true;
|
||||
if (_frame != _videoDecoder->getCurFrame()) {
|
||||
_updateNeeded = true;
|
||||
}
|
||||
|
||||
_movieTime = _videoDecoder->getTime();
|
||||
_frame = _videoDecoder->getCurFrame();
|
||||
|
@ -56,7 +56,8 @@ void SmushPlayer::init() {
|
||||
}
|
||||
|
||||
void SmushPlayer::handleFrame() {
|
||||
if (_videoDecoder->endOfVideo()) {
|
||||
// Force the last frame to stay in place for it's duration:
|
||||
if (_videoDecoder->endOfVideo() && _videoDecoder->getTime() >= _videoDecoder->getDuration().msecs()) {
|
||||
// If we're not supposed to loop (or looping fails) then end the video
|
||||
if (!_videoLooping ) {
|
||||
_videoFinished = true;
|
||||
|
Loading…
Reference in New Issue
Block a user