diff options
author | Max Horn | 2003-06-22 13:50:46 +0000 |
---|---|---|
committer | Max Horn | 2003-06-22 13:50:46 +0000 |
commit | b4ce2163272a0141915ac17147c64548a880f669 (patch) | |
tree | 99036a3ed83c19365e2c1cd0798a5babab6248ef /sound | |
parent | d2b61e9bef797bde839c665ce4867d939e52f37c (diff) | |
download | scummvm-rg350-b4ce2163272a0141915ac17147c64548a880f669.tar.gz scummvm-rg350-b4ce2163272a0141915ac17147c64548a880f669.tar.bz2 scummvm-rg350-b4ce2163272a0141915ac17147c64548a880f669.zip |
don't memset the output buffer to 0 if _eof_flag is set; rather, we should 'add 0' to every byte in the output buffer, i.e.: do nothing
svn-id: r8609
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 9bdf893ace..3af042ad86 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -1077,7 +1077,6 @@ ChannelVorbis::ChannelVorbis(SoundMixer *mixer, OggVorbis_File *ov_file, int dur void ChannelVorbis::mix(int16 *data, uint len) { if (_eof_flag) { - memset(data, 0, sizeof(int16) * 2 * len); return; } @@ -1099,21 +1098,18 @@ void ChannelVorbis::mix(int16 *data, uint len) { if (result == 0) { _eof_flag = true; memset(read_pos, 0, len_left); - break; - } - else if (result == OV_HOLE) { + len_left = 0; + } else if (result == OV_HOLE) { // Possibly recoverable, just warn about it warning("Corrupted data in Vorbis file"); - } - else if (result < 0) { + } else if (result < 0) { debug(1, "Decode error %d in Vorbis file", result); // Don't delete it yet, that causes problems in // the CD player emulation code. _eof_flag = true; memset(read_pos, 0, len_left); - break; - } - else { + len_left = 0; + } else { len_left -= result; read_pos += result; } |