svn-id: r9259
This commit is contained in:
Max Horn 2003-07-28 20:25:09 +00:00
parent c6a4a1d37d
commit ed6521f332

View File

@ -933,6 +933,7 @@ void ChannelMP3CDMusic::mix(int16 *data, uint len) {
memset(_ptr, 0, _bufferSize);
_size = _file->read(_ptr, _bufferSize);
if (_size <= 0) {
debug(1, "Failed to read MP3 data during channel initialisation !");
destroy();
return;
}
@ -1006,6 +1007,9 @@ void ChannelMP3CDMusic::mix(int16 *data, uint len) {
memcpy(_ptr, _stream.next_frame, not_decoded);
_size = _file->read(_ptr + not_decoded, _bufferSize - not_decoded);
}
if (_size <= 0) {
return;
}
_stream.error = (enum mad_error)0;
// Restream
mad_stream_buffer(&_stream, _ptr, _size + not_decoded);