From 714c6ae1195ac372998c3d5b6f3739725554bf85 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 25 Jul 2012 00:44:22 -0400 Subject: VIDEO: Add internal helper function for checking on video track end status --- video/video_decoder.cpp | 8 ++++++++ video/video_decoder.h | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'video') 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 TrackList; -- cgit v1.2.3