From 341c3abad549aeb6217fbb1325249c6d3a1a00e8 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sat, 1 Sep 2012 18:57:29 +0200 Subject: VIDEO: Constified a temporary --- video/qt_decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video') diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 87c530dba0..b4dab9ddfb 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -216,7 +216,7 @@ void QuickTimeDecoder::init() { addTrack(new AudioTrackHandler(this, _audioTracks[i])); // Initialize all the video tracks - Common::Array &tracks = Common::QuickTimeParser::_tracks; + const Common::Array &tracks = Common::QuickTimeParser::_tracks; for (uint32 i = 0; i < tracks.size(); i++) { if (tracks[i]->codecType == CODEC_TYPE_VIDEO) { for (uint32 j = 0; j < tracks[i]->sampleDescs.size(); j++) -- cgit v1.2.3 From 058b9b9aca066c886ceb4e454a5541be70c27cb6 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 5 Sep 2012 11:27:01 -0400 Subject: VIDEO: Restrict setEndTime()'s affects to videos that are playing --- video/video_decoder.cpp | 4 ++-- video/video_decoder.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index e79043629c..c9d3d22070 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 7ccf49a0af..daf78c227a 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); -- cgit v1.2.3