[Scummvm-cvs-logs] SF.net SVN: scummvm:[46162] scummvm/trunk/graphics/video
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Fri Nov 27 19:25:42 CET 2009
Revision: 46162
http://scummvm.svn.sourceforge.net/scummvm/?rev=46162&view=rev
Author: drmccoy
Date: 2009-11-27 18:25:40 +0000 (Fri, 27 Nov 2009)
Log Message:
-----------
Extended the AviDecoder a bit
Modified Paths:
--------------
scummvm/trunk/graphics/video/avi_decoder.cpp
scummvm/trunk/graphics/video/avi_decoder.h
Modified: scummvm/trunk/graphics/video/avi_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/avi_decoder.cpp 2009-11-27 06:46:07 UTC (rev 46161)
+++ scummvm/trunk/graphics/video/avi_decoder.cpp 2009-11-27 18:25:40 UTC (rev 46162)
@@ -236,7 +236,7 @@
// Now, create the codec
_videoCodec = createCodec();
-
+
// Initialize the video stuff too
_audStream = createAudioStream();
if (_audStream)
@@ -255,6 +255,9 @@
// Our frameDelay is calculated in 1/100 ms, so we convert it here
_videoInfo.frameDelay = _header.microSecondsPerFrame / 10;
+ if (!_videoCodec)
+ return false;
+
return true;
}
@@ -274,12 +277,18 @@
_decodedHeader = false;
delete _videoCodec;
+ _videoCodec = 0;
+
delete[] _ixInfo.indices;
+ _ixInfo.indices = 0;
}
Surface *AviDecoder::getNextFrame() {
uint32 nextTag = _fileStream->readUint32BE();
-
+
+ if (_fileStream->eos())
+ return NULL;
+
if (nextTag == ID_LIST) {
// A list of audio/video chunks
uint32 listSize = _fileStream->readUint32LE() - 4;
@@ -340,8 +349,12 @@
// No alignment necessary. It's always even.
} else if (nextTag == ID_JUNK) {
runHandle(ID_JUNK);
+ } else if (nextTag == ID_00AM) {
+ runHandle(ID_JUNK);
+ } else if (nextTag == ID_IDX1) {
+ runHandle(ID_IDX1);
} else
- error ("Tag = \'%s\'", tag2str(nextTag));
+ error ("Tag = \'%s\', %d", tag2str(nextTag), _fileStream->pos());
return NULL;
}
@@ -352,9 +365,16 @@
Surface *surface = NULL;
- while (!surface && _videoInfo.currentFrame < _videoInfo.frameCount)
+ uint32 curFrame = _videoInfo.currentFrame;
+
+ while (!surface && _videoInfo.currentFrame < _videoInfo.frameCount && !_fileStream->eos())
surface = getNextFrame();
+ if (curFrame == _videoInfo.currentFrame) {
+ warning("No video frame found");
+ _videoInfo.currentFrame++;
+ }
+
if (surface)
memcpy(_videoFrameBuffer, surface->pixels, _header.width * _header.height);
Modified: scummvm/trunk/graphics/video/avi_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/avi_decoder.h 2009-11-27 06:46:07 UTC (rev 46161)
+++ scummvm/trunk/graphics/video/avi_decoder.h 2009-11-27 18:25:40 UTC (rev 46162)
@@ -56,6 +56,7 @@
#define ID_VEDT MKID_BE('vedt')
#define ID_IDX1 MKID_BE('idx1')
#define ID_STRD MKID_BE('strd')
+#define ID_00AM MKID_BE('00AM')
//#define ID_INFO MKID_BE('INFO')
// Codec tags
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