fix(libSceVideodec2): decode after a flush without a reset #7252
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7252"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-17T19:45:22Z.
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(#5271, fixed by #6976) andagc_driver_layered_volume_vertex_no_gpl(#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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T20:34:21Z.
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.
main)docs/dev/debt/libSceVideodec2.mdL13Some 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.
core/libs/tests/GuestVideodec2.cppcore/libs/prx/libSceVideodec2/Export.cpp