cellDmuxPamf: fix stream cache not being consumed in some cases

This commit is contained in:
capriots 2026-03-07 16:30:38 +01:00 committed by Elad
parent 4828d4d2d6
commit 2573cc5fd0

View File

@ -354,9 +354,10 @@ u32 dmux_pamf_base::video_stream<avc>::parse_stream(std::span<const u8> 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<ac3>::parse_stream(std::span<const u8> 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)
{