[Scummvm-cvs-logs] CVS: scummvm sound.cpp,1.72,1.73
Lionel Ulmer
bbrox at users.sourceforge.net
Fri May 3 15:31:03 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv19847
Modified Files:
sound.cpp
Log Message:
Finally easier than what I thought... Removed the last 'float' from
the sound code :-)
People with LoomCD and MP3 tracks should test that I did not break
anything.
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- sound.cpp 3 May 2002 21:11:16 -0000 1.72
+++ sound.cpp 3 May 2002 21:37:49 -0000 1.73
@@ -902,8 +902,7 @@
int Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
int index;
- long offset;
- float frame_size;
+ unsigned int offset;
mad_timer_t duration;
g_scumm->_vars[g_scumm->VAR_MI1_TIMER] = 0;
@@ -919,9 +918,8 @@
if (index < 0)
return -1;
- // Calc offset
- frame_size = (float)(144 * _mad_header[index].bitrate / _mad_header[index].samplerate);
- offset = (long)( (float)start / (float)75 * ((float)_mad_header[index].bitrate/(float)8));
+ // Calc offset. As all bitrates are in kilobit per seconds, the division by 200 is always exact
+ offset = (start * (_mad_header[index].bitrate / (8 * 25))) / 3;
// Calc delay
if (!delay) {
More information about the Scummvm-git-logs
mailing list