Repository navigation
fix(libSceVideodec2): decode after a flush without a reset - #7252
Merged
oneandonlydean merged 1 commit intoOct 17, 2026
Merged
Conversation
sceVideodec2Decode threw when it followed sceVideodec2Flush without sceVideodec2Reset. It now resets FFmpeg's drained decoder and decodes the unit, keeping the pictures the flush has not returned yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TEKKEN DARK RESURRECTION (PPSA31371) runs in Sony's PSP emulator. With its first stop (#7118, #7251) cleared locally, the reporter's run reaches the Bandai Namco logo, starts a 480x272 H.264 video and aborts with
Videodec2: reset required after flushing(#7118).sceVideodec2Decodethrew whenever it was called aftersceVideodec2Flushwithout asceVideodec2Resetin between, so the title makes that call. Since the title runs on the console, the console's library accepts it.sceVideodec2Decodenow restarts FFmpeg's decoder after a flush (avcodec_flush_buffers, which FFmpeg requires before a drained decoder takes new packets) and decodes the unit. The decoder keeps whatsceVideodec2Resetwould clear:shadPS4's
VdecDecoder::Decodedoes the same when FFmpeg reports end of stream (videodec2_impl.cpp).A technical debt entry records that what the console returns for pictures still queued at that point, and for a stream that continues across the flush without a new IDR picture, is not measured.
Tested
Windows 11 26200, Ryzen 5 5600X, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON:guest_videodec2has a new case,testDecodeAfterFlush. It flushes a new H.264 decoder that has decoded nothing, then twice decodes the 6-picture fixture clip and flushes it until no picture is left, with no reset in between. Every picture must come out in display order with its timestamps and match the reference NV12 hash.sceVideodec2Decodeas onmainit fails with the title's message:Videodec2: reset required after flushing.ctest --parallel 4 --timeout 120onmain922dc8999with this change: 1400 tests. Onlyagc_driver_lds_mixed_width_atomics(agc_* tests: 3 of 483 fail on AMD Radeon RX 6400, pass on NVIDIA RTX 4080 SUPER #5271, fixed by fix(shader): release the LDS lock with an exchange and drop fences inside it #6976) andagc_driver_layered_volume_vertex_no_gpl(AMD Windows: GPL-mode cache failures (alpha/wave32 pass after local driver update) #4768) fail, as onmainhere.python tools/check_conventions.py --base origin/mainwith this title and body passes.guest_videodec2there).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code