[Scummvm-cvs-logs] scummvm master -> 058b9b9aca066c886ceb4e454a5541be70c27cb6
clone2727
clone2727 at gmail.com
Wed Sep 5 17:40:56 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
058b9b9aca VIDEO: Restrict setEndTime()'s affects to videos that are playing
Commit: 058b9b9aca066c886ceb4e454a5541be70c27cb6
https://github.com/scummvm/scummvm/commit/058b9b9aca066c886ceb4e454a5541be70c27cb6
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-09-05T08:27:01-07:00
Commit Message:
VIDEO: Restrict setEndTime()'s affects to videos that are playing
Changed paths:
video/video_decoder.cpp
video/video_decoder.h
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index e790436..c9d3d22 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -250,7 +250,7 @@ uint32 VideoDecoder::getTimeToNextFrame() const {
bool VideoDecoder::endOfVideo() const {
for (TrackList::const_iterator it = _tracks.begin(); it != _tracks.end(); it++)
- if (!(*it)->endOfTrack() && ((*it)->getTrackType() != Track::kTrackTypeVideo || !_endTimeSet || ((VideoTrack *)*it)->getNextFrameStartTime() < (uint)_endTime.msecs()))
+ if (!(*it)->endOfTrack() && (!isPlaying() || (*it)->getTrackType() != Track::kTrackTypeVideo || !_endTimeSet || ((VideoTrack *)*it)->getNextFrameStartTime() < (uint)_endTime.msecs()))
return false;
return true;
@@ -674,7 +674,7 @@ bool VideoDecoder::hasFramesLeft() const {
// This is only used for needsUpdate() atm so that setEndTime() works properly
// And unlike endOfVideoTracks(), this takes into account _endTime
for (TrackList::const_iterator it = _tracks.begin(); it != _tracks.end(); it++)
- if ((*it)->getTrackType() == Track::kTrackTypeVideo && !(*it)->endOfTrack() && (!_endTimeSet || ((VideoTrack *)*it)->getNextFrameStartTime() < (uint)_endTime.msecs()))
+ if ((*it)->getTrackType() == Track::kTrackTypeVideo && !(*it)->endOfTrack() && (!isPlaying() || !_endTimeSet || ((VideoTrack *)*it)->getNextFrameStartTime() < (uint)_endTime.msecs()))
return true;
return false;
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 7ccf49a..daf78c2 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -180,6 +180,9 @@ public:
/**
* Set the time for this video to end at. At this time in the video,
* all audio will stop and endOfVideo() will return true.
+ *
+ * While the setting is stored even if a video is not playing,
+ * endOfVideo() is only affected when the video is playing.
*/
void setEndTime(const Audio::Timestamp &endTime);
More information about the Scummvm-git-logs
mailing list