Skip to content

fix(disc): recognize a DVD-Video image that has no ISO9660 bridge - #737

Merged
superuser404notfound merged 1 commit into
superuser404notfound:mainfrom
yipengfei329:fix/udf-only-dvd-image
Oct 12, 2026
Merged

superuser404notfound merged 1 commit into
superuser404notfound:mainfrom
yipengfei329:fix/udf-only-dvd-image

Conversation

@yipengfei329

Copy link
Copy Markdown
Contributor

Summary

DVD recognition only lists VIDEO_TS through ISO9660, so a DVD-Video image that is UDF only (no ISO9660 bridge volume; sector 16 starts UDF's BEA01 directly) goes down the Blu-ray branch, finds no BDMV, and is opened raw: the session plays the first VOB, which is the menu. This lists VIDEO_TS through UDFReader for such an image and builds the title the way the ISO9660 path does. It is MovieClaw P61 from #703; one image in 19 DVD images in our library has this layout.

What changed

  • DiscReader.wrap: for a source without the ISO9660 signature it reads the UDF anchor once, tries Blu-ray (wrapBluRay(udfAnchorChecked: true), so the anchor is not read twice), and only when no BDMV is found tries wrapUDFDVD. A source with neither signature returns nil after the same two sniffs as before.
  • wrapUDFDVD lists the root's VIDEO_TS through UDF and turns each file into a DiscFile. DVD files are one contiguous run on disc; a file whose runs do not continue each other is left out rather than read across the gap.
  • wrapDVD is the ISO9660 branch's title-set code moved into a helper that takes a listing and a sector size, unchanged otherwise (VMGI filtering, VTS IFO durations, chapters, languages, subpicture ids, recognition cache). An ISO9660 VIDEO_TS with no title VOBs still falls back to Blu-ray, as before.
  • DiscInspector reports such an image as dvdVideo (it said udfNoBDMV while playback recognized it).
  • Tests: UDFFixture.makeDVD(files:fragmented:) builds a UDF-only DVD image; the volume descriptors make wrote are now a shared writeVolume, and the Blu-ray fixtures are byte-for-byte unchanged.
  • docs/formats.md (Disc) and CHANGELOG.

Test plan

  • Device / OS: MacBook Pro (Mac14,5, M2 Max), macOS 27.0.1, Xcode 27.0 (27A266a).
  • Real remote image from a NAS, The Little Chinese Seamstress (6.5 GB, UDF only, ISO9660=false UDF-anchor=true, 720x480 MPEG-2 PS), served by a local Range origin, aetherctl play <url> --seconds 45:
    • Stock 7.33.2: dur=7.9, the menu VOB; seeks clamp to 7.94 s.
    • With this: dur=6364.0 (the IFO's duration), 2 titles, the film plays from the start; disc-inspect says Verdict: dvdVideo, DiscReader.wrap: RECOGNIZED (format hint: mpeg).
  • Not fixed here, and not specific to this layout: a seek to 2000 s on this disc ends the session (end of media: clock parked at 2000.059s). Stock 7.33.2 does exactly the same on an ISO9660 DVD of the same shape (He's a Woman, She's a Man, dur=6349). Both discs restart their timestamps between cells (cell 7 of the first starts at 147.9 s at title time 3569 s), so a timestamp search over the title's concatenated VOBs cannot land. Folding each cell onto the title timeline and seeking by the VTS time map (feat(engine): contribute MovieClaw VOD and remote-disc extensions #703, P13) fixes both; it would be the next PR.
  • New UDFOnlyDVDImageTests (5): the main title set's two VOBs read back to back and the second title selectable; a fragmented file left out; a VIDEO_TS with no title VOBs is not a disc; DiscInspector agrees with playback; a source that is no disc sniffs the UDF anchor exactly once. The first three fail on 7.33.2; the last two pass on both, as guards.
  • Full swift test --jobs 8: 737 XCTest cases (1 skipped) and 4,203 Swift Testing cases in 584 suites, all passing. Scripts/check-doc-links.py passes.

Checklist

  • CHANGELOG.md updated
  • Commit messages follow Conventional Commits (feat(...), fix(...), chore(...))
  • The fix lives in the engine, not in a host-side workaround
  • Public API changes are intentional and documented (none)

🤖 Generated with Claude Code

DVD recognition only listed VIDEO_TS through ISO9660, so a UDF-only image
(sector 16 starts BEA01 directly) went down the Blu-ray branch, found no BDMV
and was opened raw: the session played the first VOB, the menu. On a real
remote image, The Little Chinese Seamstress reported 7.9 s; it now reports
6364 s as its IFO declares and plays the title set.

DiscReader.wrap reads the UDF anchor once for a non-ISO9660 source, tries
Blu-ray, and with no BDMV lists VIDEO_TS through UDFReader (wrapUDFDVD). The
title set is built by the code the ISO9660 path already used, now wrapDVD,
which takes a listing and a sector size. A file recorded as runs that do not
continue each other is left out. DiscInspector reports such an image as
dvdVideo.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@superuser404notfound
superuser404notfound merged commit 0b4a1f0 into superuser404notfound:main Oct 12, 2026
4 checks passed
@superuser404notfound

Copy link
Copy Markdown
Owner

Merged in 0b4a1f0, thank you. The only conflict was docs/formats.md, where #736 had extended the Blu-ray paragraph; both texts are kept. The full suite is green on the merge (747 XCTest, 4316 Swift Testing). It will ship with the next release. The VTS time-map seek for discs whose cells restart their timestamps sounds like the right next step, looking forward to that one.

superuser404notfound pushed a commit that referenced this pull request Oct 12, 2026
…eek it by its time map

Resolved against 7.35.0/7.35.1: DiscInfo, DiscRecognition and the
recognition cache carry both the Blu-ray EP-map seek table (AE#736) and
the DVD time map; the seek paths try the EP maps, then the time map,
then the timestamp search. A UDF-only DVD image (#737) shares the DVD
wrap and so gets the cell fold too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
yipengfei329 added a commit to yipengfei329/AetherEngine that referenced this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants