From 35d305ce64a702d1d34fd5a5c0a5ddb7c1cf40c2 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Sat, 27 Apr 2002 07:42:14 +0000 Subject: 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 --- sound.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sound.cpp') 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; } -- cgit v1.2.3