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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Thu Nov 11 18:05:33 CET 2010


Revision: 54205
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54205&view=rev
Author:   mthreepwood
Date:     2010-11-11 17:05:33 +0000 (Thu, 11 Nov 2010)

Log Message:
-----------
VIDEO: Add support for DK3 in videos; fix sample rate location

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	2010-11-11 17:04:07 UTC (rev 54204)
+++ scummvm/trunk/graphics/video/avi_decoder.cpp	2010-11-11 17:05:33 UTC (rev 54205)
@@ -34,6 +34,7 @@
 #include "graphics/video/avi_decoder.h"
 
 // Audio Codecs
+#include "sound/decoders/adpcm.h"
 #include "sound/decoders/raw.h"
 
 // Video Codecs
@@ -269,8 +270,8 @@
 
 	debug (0, "Frames = %d, Dimensions = %d x %d", _header.totalFrames, _header.width, _header.height);
 	debug (0, "Frame Rate = %d", _vidsHeader.rate / _vidsHeader.scale);
-	if ((_audsHeader.scale != 0) && (_header.flags & AVIF_ISINTERLEAVED))
-		debug (0, "Sound Rate = %d", AUDIO_RATE);
+	if (_wvInfo.samplesPerSec != 0)
+		debug (0, "Sound Rate = %d", _wvInfo.samplesPerSec);
 	debug (0, "Video Codec = \'%s\'", tag2str(_vidsHeader.streamHandler));
 
 	if (!_videoCodec)
@@ -422,10 +423,8 @@
 }
 
 Audio::QueuingAudioStream *AviDecoder::createAudioStream() {
-	if (_wvInfo.tag == kWaveFormatPCM)
-		return Audio::makeQueuingAudioStream(AUDIO_RATE, _wvInfo.channels == 2);
-	else if (_wvInfo.tag == kWaveFormatDK3)
-		warning("Unsupported DK3 IMA ADPCM sound");
+	if (_wvInfo.tag == kWaveFormatPCM || _wvInfo.tag == kWaveFormatDK3)
+		return Audio::makeQueuingAudioStream(_wvInfo.samplesPerSec, _wvInfo.channels == 2);
 	else if (_wvInfo.tag != kWaveFormatNone) // No sound
 		warning("Unsupported AVI audio format %d", _wvInfo.tag);
 
@@ -451,7 +450,9 @@
 		if (_wvInfo.channels == 2)
 			flags |= Audio::FLAG_STEREO;
 
-		_audStream->queueAudioStream(Audio::makeRawStream(stream, AUDIO_RATE, flags, DisposeAfterUse::YES), DisposeAfterUse::YES);
+		_audStream->queueAudioStream(Audio::makeRawStream(stream, _wvInfo.samplesPerSec, flags, DisposeAfterUse::YES), DisposeAfterUse::YES);
+	} else if (_wvInfo.tag == kWaveFormatDK3) {
+		_audStream->queueAudioStream(Audio::makeADPCMStream(stream, DisposeAfterUse::YES, chunkSize, Audio::kADPCMDK3, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign), DisposeAfterUse::YES);
 	}
 }
 

Modified: scummvm/trunk/graphics/video/avi_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/avi_decoder.h	2010-11-11 17:04:07 UTC (rev 54204)
+++ scummvm/trunk/graphics/video/avi_decoder.h	2010-11-11 17:05:33 UTC (rev 54205)
@@ -34,7 +34,6 @@
 namespace Graphics {
 
 #define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a))
-#define AUDIO_RATE (_audsHeader.rate / _audsHeader.scale)
 
 // IDs used throughout the AVI files
 // that will be handled by this player


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