aboutsummaryrefslogtreecommitdiff
path: root/sound/mixer.cpp
diff options
context:
space:
mode:
authorLionel Ulmer2002-04-16 19:49:15 +0000
committerLionel Ulmer2002-04-16 19:49:15 +0000
commit0d580b358e752067276f254e2709530f24da6b7f (patch)
tree64e64810c26922e131619d9de2df9a46c5cc0326 /sound/mixer.cpp
parentef5c23c6085a8d8fb7e2bd9f7dad5645d6170c35 (diff)
downloadscummvm-rg350-0d580b358e752067276f254e2709530f24da6b7f.tar.gz
scummvm-rg350-0d580b358e752067276f254e2709530f24da6b7f.tar.bz2
scummvm-rg350-0d580b358e752067276f254e2709530f24da6b7f.zip
Small fix to get sounds to actually finish :-)
svn-id: r3963
Diffstat (limited to 'sound/mixer.cpp')
-rw-r--r--sound/mixer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index ab995be58e..88c7356438 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -251,7 +251,8 @@ void SoundMixer::Channel_MP3::mix(int16 *data, uint len) {
return;
if (_position >= _size) {
- return; /* TODO : add equivalent to 'clear' */
+ destroy();
+ return;
}
mad_stream_buffer(&_stream, ((unsigned char *)_ptr) + _position, _size + MAD_BUFFER_GUARD - _position);
@@ -259,7 +260,8 @@ void SoundMixer::Channel_MP3::mix(int16 *data, uint len) {
if (mad_frame_decode(&_frame, &_stream) == -1) {
/* End of audio... */
if (_stream.error == MAD_ERROR_BUFLEN) {
- return; /* TODO : add equivalent to 'clear' */
+ destroy();
+ return;
} else if (!MAD_RECOVERABLE(_stream.error)) {
error("MAD frame decode error !");
}