mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-02-09 09:15:55 +01:00
cellMusicDecode: fix random pop at the end of a stream
Observed in SSX, which seems to ignore the readSize sometimes
This commit is contained in:
parent
b5f3f910f6
commit
b67837c0ef
|
|
@ -227,6 +227,12 @@ error_code cell_music_decode_read(vm::ptr<void> buf, vm::ptr<u32> startTime, u64
|
|||
|
||||
std::memcpy(buf.get_ptr(), &dec.decoder.data[dec.read_pos], size_to_read);
|
||||
|
||||
if (size_to_read < reqSize)
|
||||
{
|
||||
// Set the rest of the buffer to zero to prevent loud pops at the end of the stream if the game ignores the readSize.
|
||||
std::memset(vm::static_ptr_cast<u8>(buf).get_ptr() + size_to_read, 0, reqSize - size_to_read);
|
||||
}
|
||||
|
||||
dec.read_pos += size_to_read;
|
||||
|
||||
s64 start_time_ms = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue