diff --git a/rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp b/rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp index f8fd42f4a4..91ee7e2426 100644 --- a/rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp +++ b/rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp @@ -354,9 +354,10 @@ u32 dmux_pamf_base::video_stream::parse_stream(std::span stream) { au_chunk.data = { au_chunk_begin, stream_it }; std::copy_n(cache.begin(), cache_idx, std::back_inserter(au_chunk.cached_data)); - cache.erase(cache.begin(), cache.begin() + cache_idx); } + cache.erase(cache.begin(), cache.begin() + cache_idx); + // Cache the end of the stream if an access unit wasn't completed. There could be the beginning of a delimiter in the last three bytes if (current_au.state != access_unit::state::complete) { @@ -499,9 +500,10 @@ u32 dmux_pamf_base::audio_stream::parse_stream(std::span stream) { au_chunk.data = { au_chunk_begin, stream_it }; std::copy_n(cache.begin(), cache_idx, std::back_inserter(au_chunk.cached_data)); - cache.erase(cache.begin(), cache.begin() + cache_idx); } + cache.erase(cache.begin(), cache.begin() + cache_idx); + // Cache the end of the stream if an access unit wasn't completed. There could be the beginning of a delimiter in the last three bytes if (current_au.state != access_unit::state::complete && current_au.state != access_unit::state::size_mismatch) {