[Scummvm-cvs-logs] SF.net SVN: scummvm: [30521] scummvm/trunk/engines/scumm/imuse_digi

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Wed Jan 16 23:20:35 CET 2008


Revision: 30521
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30521&view=rev
Author:   aquadran
Date:     2008-01-16 14:20:34 -0800 (Wed, 16 Jan 2008)

Log Message:
-----------
experimental seek in compressed streams in dimuse in time ms resolution

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2008-01-16 21:37:53 UTC (rev 30520)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2008-01-16 22:20:34 UTC (rev 30521)
@@ -177,13 +177,13 @@
 				continue;
 			}
 
-			if (track->sndDataExtComp) {
+/*			if (track->sndDataExtComp) {
 				track->regionOffset = 0;
 			}
 			track->sndDataExtComp = _sound->isSndDataExtComp(track->soundDesc);
 			if (track->sndDataExtComp) {
 				track->regionOffset = 0;
-			}
+			}*/
 			track->dataOffset = _sound->getRegionOffset(track->soundDesc, track->curRegion);
 			int bits = _sound->getBits(track->soundDesc);
 			int channels = _sound->getChannels(track->soundDesc);

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp	2008-01-16 21:37:53 UTC (rev 30520)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp	2008-01-16 22:20:34 UTC (rev 30521)
@@ -654,6 +654,7 @@
 		*buf = new byte[size];
 		assert(*buf);
 		char fileName[24];
+		int offsetMs = ((offset * 8 * 1000) / soundDesc->bits) / (soundDesc->channels * soundDesc->freq);
 		sprintf(fileName, "%s_reg%03d", soundDesc->name, region);
 		if (scumm_stricmp(fileName, soundDesc->lastFileName) != 0) {
 			int32 offs = 0, len = 0;
@@ -695,25 +696,26 @@
 				assert(tmp);
 #ifdef USE_FLAC
 				if (soundMode == 3)
-					soundDesc->compressedStream = Audio::makeFlacStream(tmp, true);
+					soundDesc->compressedStream = Audio::makeFlacStream(tmp, true, offsetMs);
 #endif
 #ifdef USE_VORBIS
 				if (soundMode == 2)
-					soundDesc->compressedStream = Audio::makeVorbisStream(tmp, true);
+					soundDesc->compressedStream = Audio::makeVorbisStream(tmp, true, offsetMs);
 #endif
 #ifdef USE_MAD
 				if (soundMode == 1)
-					soundDesc->compressedStream = Audio::makeMP3Stream(tmp, true);
+					soundDesc->compressedStream = Audio::makeMP3Stream(tmp, true, offsetMs);
 #endif
 				assert(soundDesc->compressedStream);
 			}
 			strcpy(soundDesc->lastFileName, fileName);
 		}
 		size = soundDesc->compressedStream->readBuffer((int16 *)*buf, size / 2) * 2;
-		if (soundDesc->compressedStream->endOfData()) {
+		if (soundDesc->compressedStream->endOfData() || soundDesc->endFlag) {
 			delete soundDesc->compressedStream;
 			soundDesc->compressedStream = NULL;
 			soundDesc->lastFileName[0] = 0;
+			soundDesc->endFlag = true;
 		}
 	}
 


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