From 2573cc5fd08a2d5e4b38768ae1c69779397d70b4 Mon Sep 17 00:00:00 2001 From: capriots <29807355+capriots@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:30:38 +0100 Subject: [PATCH] cellDmuxPamf: fix stream cache not being consumed in some cases --- rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {