[Scummvm-cvs-logs] SF.net SVN: scummvm:[49245] scummvm/trunk/graphics/video/qt_decoder.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed May 26 17:42:26 CEST 2010


Revision: 49245
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49245&view=rev
Author:   mthreepwood
Date:     2010-05-26 15:42:26 +0000 (Wed, 26 May 2010)

Log Message:
-----------
Take any 'moov' resource from a resource fork, not just 0x80; minor cleanup.

Modified Paths:
--------------
    scummvm/trunk/graphics/video/qt_decoder.cpp

Modified: scummvm/trunk/graphics/video/qt_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/qt_decoder.cpp	2010-05-26 15:41:50 UTC (rev 49244)
+++ scummvm/trunk/graphics/video/qt_decoder.cpp	2010-05-26 15:42:26 UTC (rev 49245)
@@ -279,7 +279,12 @@
 	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 @@
 
 	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 @@
 		delete _streams[i];
 
 	delete _fd;
+	_fd = 0;
 
 	if (_scaledSurface) {
 		_scaledSurface->free();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list