diff options
author | Paul Gilbert | 2017-06-30 20:34:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-06-30 20:34:28 -0400 |
commit | a897ad9e7222a3f8af1d75bc9c787da3bd464c33 (patch) | |
tree | 0a0f4f412bb24e3cb97d55067211cf6311a79448 /video | |
parent | 1b03df5313e917b19dd4820fe11638b9488f1c1e (diff) | |
download | scummvm-rg350-a897ad9e7222a3f8af1d75bc9c787da3bd464c33.tar.gz scummvm-rg350-a897ad9e7222a3f8af1d75bc9c787da3bd464c33.tar.bz2 scummvm-rg350-a897ad9e7222a3f8af1d75bc9c787da3bd464c33.zip |
VIDEO: Add method to VideoDecoder to erase a track
Diffstat (limited to 'video')
-rw-r--r-- | video/video_decoder.cpp | 17 | ||||
-rw-r--r-- | video/video_decoder.h | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 05b6e7ce2a..e4016d8de8 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -910,4 +910,21 @@ bool VideoDecoder::hasAudio() const { return false; } +void VideoDecoder::eraseTrack(Track *track) { + for (uint idx = 0; idx < _externalTracks.size(); ++idx) { + if (_externalTracks[idx] == track) + _externalTracks.remove_at(idx); + } + + for (uint idx = 0; idx < _internalTracks.size(); ++idx) { + if (_internalTracks[idx] == track) + _internalTracks.remove_at(idx); + } + + for (uint idx = 0; idx < _tracks.size(); ++idx) { + if (_tracks[idx] == track) + _tracks.remove_at(idx); + } +} + } // End of namespace Video diff --git a/video/video_decoder.h b/video/video_decoder.h index a415a70724..598a67d3f8 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -886,6 +886,11 @@ protected: TrackListIterator getTrackListEnd() { return _internalTracks.end(); } /** + * Removes a specified track + */ + void eraseTrack(Track *track); + + /** * The internal seek function that does the actual seeking. * * @see seek() |