aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorLionel Ulmer2002-05-03 21:37:49 +0000
committerLionel Ulmer2002-05-03 21:37:49 +0000
commitbcae301bf7e2489493b768e770938d0a293e9f85 (patch)
treed61dfa01d4fe052647cba9866b042b59b0367b7f /sound.cpp
parentaa09cbf8fed6cc9cd8b461fd5f09a979d1f2a218 (diff)
downloadscummvm-rg350-bcae301bf7e2489493b768e770938d0a293e9f85.tar.gz
scummvm-rg350-bcae301bf7e2489493b768e770938d0a293e9f85.tar.bz2
scummvm-rg350-bcae301bf7e2489493b768e770938d0a293e9f85.zip
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. svn-id: r4186
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound.cpp b/sound.cpp
index 397e0d43d8..daf071f8c8 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -902,8 +902,7 @@ int Scumm::getCachedTrack(int track) {
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 @@ int Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
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) {