diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index c9d3d22070b..24287c4d331 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -35,7 +35,6 @@ namespace Video { VideoDecoder::VideoDecoder() { _startTime = 0; - _needsRewind = false; _dirtyPalette = false; _palette = 0; _isPlaying = false; @@ -62,7 +61,6 @@ void VideoDecoder::close() { delete *it; _tracks.clear(); - _needsRewind = false; _dirtyPalette = false; _palette = 0; _startTime = 0; @@ -271,8 +269,6 @@ bool VideoDecoder::rewind() { if (!isRewindable()) return false; - _needsRewind = false; - // Stop all tracks so they can be rewound if (isPlaying()) stopAudio(); @@ -306,8 +302,6 @@ bool VideoDecoder::seek(const Audio::Timestamp &time) { if (!isSeekable()) return false; - _needsRewind = false; - // Stop all tracks so they can be seeked if (isPlaying()) stopAudio(); @@ -337,10 +331,6 @@ void VideoDecoder::start() { _isPlaying = true; _startTime = g_system->getMillis(); - // If someone previously called stop(), we'll rewind it. - if (_needsRewind) - rewind(); - // Adjust start time if we've seeked to something besides zero time if (_lastTimeChange.totalNumberOfFrames() != 0) _startTime -= _lastTimeChange.msecs(); @@ -363,15 +353,8 @@ void VideoDecoder::stop() { // Also reset the pause state. _pauseLevel = 0; - // If this is a rewindable video, don't close it too. We'll just rewind() the video - // the next time someone calls start(). Otherwise, since it can't be rewound, we - // just close it. - if (isRewindable()) { - _lastTimeChange = getTime(); - _needsRewind = true; - } else { - close(); - } + // Keep the time marked down in case we start up again + _lastTimeChange = getTime(); } Audio::Timestamp VideoDecoder::getDuration() const { diff --git a/video/video_decoder.h b/video/video_decoder.h index daf78c227a0..66980ab09bd 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -102,16 +102,14 @@ public: /** * Begin playback of the video. * - * @note This has no effect is the video is already playing. + * @note This has no effect if the video is already playing. */ void start(); /** * Stop playback of the video. * - * @note This will close() the video if it is not rewindable. - * @note If the video is rewindable, the video will be rewound on the - * next start() call unless rewind() or seek() is called before then. + * @note This has no effect if the video is not playing. */ void stop(); @@ -765,7 +763,7 @@ private: TrackList _tracks; // Current playback status - bool _isPlaying, _needsRewind, _needsUpdate; + bool _isPlaying, _needsUpdate; Audio::Timestamp _lastTimeChange, _endTime; bool _endTimeSet;