mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12: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
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
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;
|
dec.read_pos += size_to_read;
|
||||||
|
|
||||||
s64 start_time_ms = 0;
|
s64 start_time_ms = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue