diff options
Diffstat (limited to 'sound/mixer.cpp')
-rw-r--r-- | sound/mixer.cpp | 6 |
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 !"); } |