[Scummvm-cvs-logs] SF.net SVN: scummvm:[47093] scummvm/trunk/sound/flac.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed Jan 6 21:25:19 CET 2010


Revision: 47093
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47093&view=rev
Author:   lordhoto
Date:     2010-01-06 20:25:19 +0000 (Wed, 06 Jan 2010)

Log Message:
-----------
Fix FLAC's getLength implementation.

Modified Paths:
--------------
    scummvm/trunk/sound/flac.cpp

Modified: scummvm/trunk/sound/flac.cpp
===================================================================
--- scummvm/trunk/sound/flac.cpp	2010-01-06 20:25:07 UTC (rev 47092)
+++ scummvm/trunk/sound/flac.cpp	2010-01-06 20:25:19 UTC (rev 47093)
@@ -95,7 +95,7 @@
 	/** index of the first sample to be played */
 	FLAC__uint64 _firstSample;
 
-	/** index + 1(!) of the last sample to be played - 0 is end of stream */
+	/** index + 1(!) of the last sample to be played */
 	FLAC__uint64 _lastSample;
 
 	/** total play time */
@@ -247,7 +247,7 @@
 			// Compute the start/end sample (we use floating point arithmetics here to
 			// avoid overflows).
 			_firstSample = (FLAC__uint64)(startTime * (_streaminfo.sample_rate / 1000.0));
-			_lastSample = (FLAC__uint64)(endTime * (_streaminfo.sample_rate / 1000.0));
+			_lastSample = !endTime ? _streaminfo.total_samples + 1 : (FLAC__uint64)(endTime * (_streaminfo.sample_rate / 1000.0));
 
 			if (_firstSample == 0 || seekAbsolute(_firstSample)) {
 				int32 samples = -1;


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