Commit Graph

12 Commits

Author SHA1 Message Date
0f14e2d739 Merge pull request #2251 from kirigayakazima/codex/bink-play-cmake-config-discovery
bink_play: locate the player in CMake configuration folders
2026-11-28 20:32:02 +01:00
92130437f9 Merge pull request #840 from trigger337/fix/bink-play-stage-cleanup
bink_play: close mkstemp fd on open error and restore write mode before unlink on replace failure (BINK-PLAY-STAGE-CLEANUP)
2026-11-28 12:09:09 +01:00
b05f1dd6fd bink_play: locate the player in CMake configuration folders 2026-11-26 18:18:19 +08:00
d6cee3e108 bink_play: close mkstemp fd on open error and restore write mode before unlink on replace failure (BINK-PLAY-STAGE-CLEANUP)
In load_names cache write, if opening the mkstemp file descriptor fails,
explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod
to 0o600 before unlinking to prevent Windows PermissionError on cleanup.

agent: yes
AI-assisted: yes
2026-11-24 17:26:06 +03:00
58d6fe27c1 bink_play: keep --no-cache independent of persistent storage (BINK-NO-CACHE) 2026-11-24 09:21:18 +01:00
8d39599a59 bink_play: refuse ambiguous exact movie paths 2026-11-24 03:00:46 +05:00
6d4260da81 bink_play: rebuild a malformed cached name table (#6879)
Squash-merged after diff review of PR #6879 - bink_play: rebuild a malformed name cache instead of trusting its stamp
2026-11-23 09:47:51 -06:00
ea90aad43b Merge pull request #4428 from fladit123
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:38 -05:00
fb3e15fa40 BUILD-1264: normalize Windows separators in bink --list filter 2026-11-22 22:21:56 -03:00
8365e7a99e bink_play: two lookups at once no longer share the name tool's temporary report
load_names had bink_names write its report to one fixed file next to the cache (bink_names.tmp.csv)
and staged the cache in one fixed .part file. Two lookups at once (two bink_play.py processes, or two
threads) used the same files: the second removed the report before the first read it, so the first
stopped with "bink_names.py failed" although both runs of the name tool returned 0. Found by shdann
in the review of #4014.

Each lookup now gets its own report and staging file from tempfile.mkstemp in the cache folder; the
report is removed in a finally block, and an empty report still counts as a failure, as a missing one
did. The new test holds one lookup between its report being written and read while a second one runs:
on the old code the first fails, now both get their own names and only the cache file is left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 02:11:18 +03:00
e48df32d12 bink_play: the name cache is keyed by the mount source too
bink_play.py kept the name table keyed by the archive's stamp alone, so a run with a different
--mount (another mount-list XML, or a changed common.rpf) was served the names of the previous mount
source from the cache. The key now holds the mount file's stamp (path, size, mtime) as well. A table
written in the old format has a header that no longer matches, so it is rebuilt, not misread.

tests/test_bink_play.py names the streams from old.xml, then from new.xml, with hand-built inputs and
a stubbed bink_names, and checks the second run is not served from the cache; it also checks that an
old-format table is treated as a miss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:54:38 +03:00
fb6f143da9 bink_play: play a game movie in a window, straight from its archive
runtime/test/bink_play.cpp maps the package's Bink2Scarlett.dll with rt::Loader
and plays a .bk2 at its frame rate (GDI window; pause, seek, loop). A movie
inside an archive plays where it is: archive.rpf@OFFSET goes to BinkOpen with
BinkSetFileOffset and the BINKFILEOFFSET flag, so nothing is extracted.
tools/bink_play.py finds the offset from the movie's name (bink_names.py).
CTest runs the headless smoke, which skips without a package and movie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:48:52 +00:00