diff options
author | Matthew Hoops | 2012-03-17 14:18:17 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-03-19 11:08:36 -0400 |
commit | ee0a05c32ee85c276ba98a1bb1882b618be5ca57 (patch) | |
tree | 899b3b6ccbe011f9c0d72036228f2ee18d7d0b06 /common | |
parent | 4bdd38923ad7ef66199e6ed6ccb3f89f4ec782c7 (diff) | |
download | scummvm-rg350-ee0a05c32ee85c276ba98a1bb1882b618be5ca57.tar.gz scummvm-rg350-ee0a05c32ee85c276ba98a1bb1882b618be5ca57.tar.bz2 scummvm-rg350-ee0a05c32ee85c276ba98a1bb1882b618be5ca57.zip |
COMMON: Add a dummy edit when a QuickTime file contains none
The edit just takes up the entire length of the track
Diffstat (limited to 'common')
-rw-r--r-- | common/quicktime.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/common/quicktime.cpp b/common/quicktime.cpp index 248d8b2b3a..fb01e8de28 100644 --- a/common/quicktime.cpp +++ b/common/quicktime.cpp @@ -111,19 +111,29 @@ bool QuickTimeParser::parseStream(SeekableReadStream *stream, DisposeAfterUse::F } void QuickTimeParser::init() { - // Remove unknown/unhandled tracks for (uint32 i = 0; i < _tracks.size(); i++) { + // Remove unknown/unhandled tracks if (_tracks[i]->codecType == CODEC_TYPE_MOV_OTHER) { delete _tracks[i]; _tracks.remove_at(i); i--; + } else { + // If this track doesn't have a declared scale, use the movie scale + if (_tracks[i]->timeScale == 0) + _tracks[i]->timeScale = _timeScale; + + // If this track doesn't have an edit list (like in MPEG-4 files), + // fake an entry of one edit that takes up the entire sample + if (_tracks[i]->editCount == 0) { + _tracks[i]->editCount = 1; + _tracks[i]->editList = new EditListEntry[1]; + _tracks[i]->editList[0].trackDuration = _tracks[i]->duration; + _tracks[i]->editList[0].timeOffset = 0; + _tracks[i]->editList[0].mediaTime = 0; + _tracks[i]->editList[0].mediaRate = 1; + } } } - - // Adjust time scale - for (uint32 i = 0; i < _tracks.size(); i++) - if (!_tracks[i]->timeScale) - _tracks[i]->timeScale = _timeScale; } void QuickTimeParser::initParseTable() { |