aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2012-07-25 00:44:22 -0400
committerMatthew Hoops2012-07-25 00:44:22 -0400
commit714c6ae1195ac372998c3d5b6f3739725554bf85 (patch)
tree84d11fe2b3a2197ebf3bef50847d674a5e3f3a62
parent09f1519d6d369e7e59102b53cfb56a731bff99fb (diff)
downloadscummvm-rg350-714c6ae1195ac372998c3d5b6f3739725554bf85.tar.gz
scummvm-rg350-714c6ae1195ac372998c3d5b6f3739725554bf85.tar.bz2
scummvm-rg350-714c6ae1195ac372998c3d5b6f3739725554bf85.zip
VIDEO: Add internal helper function for checking on video track end status
-rw-r--r--video/video_decoder.cpp8
-rw-r--r--video/video_decoder.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index 355c94abb1..80a208fda3 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -556,6 +556,14 @@ const AdvancedVideoDecoder::Track *AdvancedVideoDecoder::getTrack(uint track) co
return _tracks[track];
}
+bool AdvancedVideoDecoder::endOfVideoTracks() const {
+ for (TrackList::const_iterator it = _tracks.begin(); it != _tracks.end(); it++)
+ if ((*it)->getTrackType() == Track::kTrackTypeVideo && !(*it)->endOfTrack())
+ return false;
+
+ return true;
+}
+
AdvancedVideoDecoder::VideoTrack *AdvancedVideoDecoder::findNextVideoTrack() {
VideoTrack *bestTrack = 0;
uint32 bestTime = 0xFFFFFFFF;
diff --git a/video/video_decoder.h b/video/video_decoder.h
index c77fb44dfe..0848ad09c7 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -656,6 +656,14 @@ protected:
*/
const Track *getTrack(uint track) const;
+ /**
+ * Find out if all video tracks have finished
+ *
+ * This is useful if one wants to figure out if they need to buffer all
+ * remaining audio in a file.
+ */
+ bool endOfVideoTracks() const;
+
private:
// Tracks owned by this AdvancedVideoDecoder
typedef Common::Array<Track *> TrackList;