diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/video_decoder.cpp | 14 | ||||
-rw-r--r-- | video/video_decoder.h | 18 |
2 files changed, 30 insertions, 2 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 5946a7d79c..b2fcdda04c 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -519,6 +519,20 @@ void AdvancedVideoDecoder::addTrack(Track *track) { track->start(); } +AdvancedVideoDecoder::Track *AdvancedVideoDecoder::getTrack(uint track) { + if (track > _tracks.size()) + return 0; + + return _tracks[track]; +} + +const AdvancedVideoDecoder::Track *AdvancedVideoDecoder::getTrack(uint track) const { + if (track > _tracks.size()) + return 0; + + return _tracks[track]; +} + AdvancedVideoDecoder::VideoTrack *AdvancedVideoDecoder::findNextVideoTrack() { VideoTrack *bestTrack = 0; uint32 bestTime = 0xFFFFFFFF; diff --git a/video/video_decoder.h b/video/video_decoder.h index 3d8b09f26e..2a5eebfc60 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -25,7 +25,7 @@ #include "audio/mixer.h" #include "audio/timestamp.h" // TODO: Move this to common/ ? -#include "common/list.h" +#include "common/array.h" #include "common/str.h" namespace Audio { @@ -657,9 +657,23 @@ protected: */ virtual bool useAudioSync() const { return true; } + /** + * Get the given track based on its index. + * + * @return A valid track pointer on success, 0 otherwise + */ + Track *getTrack(uint track); + + /** + * Get the given track based on its index + * + * @return A valid track pointer on success, 0 otherwise + */ + const Track *getTrack(uint track) const; + private: // Tracks owned by this AdvancedVideoDecoder - typedef Common::List<Track *> TrackList; + typedef Common::Array<Track *> TrackList; TrackList _tracks; VideoTrack *findNextVideoTrack(); const VideoTrack *findNextVideoTrack() const; |