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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Feb 22 19:33:11 CET 2007


Revision: 25793
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25793&view=rev
Author:   fingolfin
Date:     2007-02-22 10:33:01 -0800 (Thu, 22 Feb 2007)

Log Message:
-----------
Reduce chance for overflows in VorbisTrackInfo::play

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

Modified: scummvm/trunk/sound/vorbis.cpp
===================================================================
--- scummvm/trunk/sound/vorbis.cpp	2007-02-22 18:21:01 UTC (rev 25792)
+++ scummvm/trunk/sound/vorbis.cpp	2007-02-22 18:33:01 UTC (rev 25793)
@@ -341,9 +341,10 @@
 		return;
 	}
 	
-	// Convert startFrame & duration from frames (1/75 s) to milliseconds (1/1000s)
-	uint start = startFrame * 1000 / 75;
-	uint end = duration ? ((startFrame + duration) * 1000 / 75) : 0;
+	// Convert startFrame & duration from frames (1/75 s) to milliseconds (1/1000s),
+	// i.e. multiple with a factor of 1000/75 = 40/3
+	uint start = startFrame * 40 / 3;
+	uint end = duration ? ((startFrame + duration) * 40 / 3) : 0;
 
 	// ... create an AudioStream ...
 	VorbisInputStream *input = new VorbisInputStream(file, true, start, end);


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