aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorLionel Ulmer2002-04-27 07:42:14 +0000
committerLionel Ulmer2002-04-27 07:42:14 +0000
commit35d305ce64a702d1d34fd5a5c0a5ddb7c1cf40c2 (patch)
treea1bb2d2c5f73c56ecbe150ccf0caae38d43ff38b /sound.cpp
parent6ac9551e815b7566ff13d02d1800286290109074 (diff)
downloadscummvm-rg350-35d305ce64a702d1d34fd5a5c0a5ddb7c1cf40c2.tar.gz
scummvm-rg350-35d305ce64a702d1d34fd5a5c0a5ddb7c1cf40c2.tar.bz2
scummvm-rg350-35d305ce64a702d1d34fd5a5c0a5ddb7c1cf40c2.zip
MP3 CD tracks should now be working properly.
Ludde, maybe you should check if Simon is still working OK as now the change of the sound playing handle is 'asynchronous' (ie if you call 'stop' on a sound, the handle will NOT be put to NULL right away, but at the next 'mix' thread call). Maybe we should completely remove this handle stuff and always use instead the index returned by the 'play_XXX' functions. svn-id: r4101
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 4f4cde0dff..5f845a25fc 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -145,7 +145,7 @@ void Scumm::processSfxQueues()
act = _vars[VAR_TALK_ACTOR];
if (_talkChannel < 0)
finished = false;
- else if (this->_mixer->_channels[_talkChannel] == NULL)
+ else if (_mixer->_channels[_talkChannel] == NULL)
finished = true;
else
finished = false;
@@ -707,8 +707,6 @@ int Scumm::getCachedTrack(int track) {
fseek(file, 0, SEEK_END);
_mp3_size[current_index] = ftell(file);
_mp3_tracks[current_index] = file;
- if (!_mp3_buffer)
- _mp3_buffer = malloc(MP3_BUFFER_SIZE);
return current_index;
@@ -729,7 +727,7 @@ int Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
return 0;
if (!num_loops && !start) {
- _mixer->stop(_mp3_handle);
+ _mixer->stop(_mp3_index);
return 0;
}
@@ -751,7 +749,7 @@ int Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
// Go
fseek(_mp3_tracks[index], offset, SEEK_SET);
- _mixer->play_mp3_cdtrack(&_mp3_handle, _mp3_tracks[index], _mp3_buffer, MP3_BUFFER_SIZE, duration);
+ _mp3_index = _mixer->play_mp3_cdtrack(NULL, _mp3_index, _mp3_tracks[index], duration);
return 0;
}