aboutsummaryrefslogtreecommitdiff
path: root/graphics/video
diff options
context:
space:
mode:
authorMatthew Hoops2010-05-26 15:42:26 +0000
committerMatthew Hoops2010-05-26 15:42:26 +0000
commit017507ffa6a774ea1df4d74b8431155540f76244 (patch)
treeece9512f16840974c17834b8efcb4057c250fc74 /graphics/video
parent7b8837cda7b3c44d5e283ef8bb9ebe6e943ebb27 (diff)
downloadscummvm-rg350-017507ffa6a774ea1df4d74b8431155540f76244.tar.gz
scummvm-rg350-017507ffa6a774ea1df4d74b8431155540f76244.tar.bz2
scummvm-rg350-017507ffa6a774ea1df4d74b8431155540f76244.zip
Take any 'moov' resource from a resource fork, not just 0x80; minor cleanup.
svn-id: r49245
Diffstat (limited to 'graphics/video')
-rw-r--r--graphics/video/qt_decoder.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp
index 244ed14a53..49d2b0aed9 100644
--- a/graphics/video/qt_decoder.cpp
+++ b/graphics/video/qt_decoder.cpp
@@ -279,7 +279,12 @@ bool QuickTimeDecoder::loadFile(const Common::String &filename) {
MOVatom atom = { 0, 0, 0xffffffff };
if (_resFork->hasResFork()) {
- _fd = _resFork->getResource(MKID_BE('moov'), 0x80);
+ // Search for a 'moov' resource
+ Common::MacResIDArray idArray = _resFork->getResIDArray(MKID_BE('moov'));
+
+ if (!idArray.empty())
+ _fd = _resFork->getResource(MKID_BE('moov'), idArray[0]);
+
if (_fd) {
atom.size = _fd->size();
if (readDefault(atom) < 0 || !_foundMOOV)
@@ -417,7 +422,7 @@ int QuickTimeDecoder::readDefault(MOVatom atom) {
a.offset = atom.offset;
- while(((total_size + 8) < atom.size) && !_fd->eos() && !err) {
+ while(((total_size + 8) < atom.size) && !_fd->eos() && _fd->pos() < _fd->size() && !err) {
a.size = atom.size;
a.type = 0;
@@ -1153,6 +1158,7 @@ void QuickTimeDecoder::close() {
delete _streams[i];
delete _fd;
+ _fd = 0;
if (_scaledSurface) {
_scaledSurface->free();