mirror of
https://github.com/freemkv/libfreemkv.git
synced 2026-10-07 18:13:10 +00:00
The fallback composite gate in rank_titles flagged title P as a "play-all wrapper" whenever some other title Q's clip set was a proper subset of P's, Q had video, and Q.size >= 0.5 * P.size. main_feature_order then ranks standalone-before-composite, demoting P below the decoy Q. On a seamless-branch feature this inverts the pick: the real 00800 (2h03, 4 clips = body + intro/credits/seamless segments) is a SUPERSET of the single-clip body decoy 00700 (1h50), and 700 >= 50% of 800's size, so 800 was mis-flagged composite and lost to the shorter 700 — the wrong title gets ripped. Add a duration-first wrapper-shape gate: P is only a composite when the subset Q is EITHER a much shorter cut (Q.duration < 0.85 * P.duration, a concat/play-all padding Q's runtime) OR nearly size-equal (Q.size >= 0.90 * P.size, a bumper/outro wrapper). A near-full-length but markedly smaller body subset (Q runs ~0.89 of P's duration yet holds far fewer bytes, because P's branch segments add bytes not runtime) is a real seamless branch, so P is kept. Uses per-title duration_secs/size_bytes, stays capacity-independent and feature-gate-safe. Preserves the real play-all avoidance: the 00245 bumper-wrapper decoy (Q ~0.96 of both duration and size) stays demoted via the size limb, and a concat play-all (subset < half the runtime) via the duration limb. Add regression tests: seamless_branch_feature_not_demoted_issue_45 and true_play_all_concat_wrapper_still_demoted. All existing selection tests pass.
libfreemkv Documentation
Technical documentation for libfreemkv, the open source optical drive library.
Start Here
Disc to Rip: End-to-End Flow — How the library goes from a disc in the drive to decrypted content. Read this first.
Reference
| Document | What it covers |
|---|---|
| Architecture | Module map, design principles, error codes, platform support |
| Drive Access | Drive, SCSI transport, profiles, unlock, why raw mode is needed |
| Rip Recovery | What this crate owns of the recovery model: single-shot Drive::read, SenseFamily, DiscStream batch halving (the strategy itself moved to freemkv-engine in 1.6.0) |
| AACS Encryption | Key resolution (4 paths), content decryption, bus encryption, SCSI handshake |
| UDF Filesystem | UDF 2.50 with metadata partitions, pointer chain, how files are read from disc |
| MPLS Playlists | Playlist format, play items, STN stream table, coding types |
| CLPI Clip Info | EP map (coarse + fine entries), timestamp-to-sector mapping, extent calculation |
| API Design | Stream API design, PES pipeline, input/output resolution |
Reading Order
If you want to understand the whole library:
- Disc to Rip — the big picture
- Architecture — how modules fit together
- Drive Access — how we talk to hardware
- UDF → MPLS → CLPI — how disc content is structured
- AACS — how encryption works and how we break it
API Documentation
Generated API docs are on docs.rs/libfreemkv.