forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 2e2ed698a69459f7ce472eabcbc01b00a0916d3fFiltered to crates/engine/tests/export.rsClear filter

2026-08-10

✨ feat(library): every audio stream is a row, and the picked one plays and exportsAhmet Kaan Gümüş · ecb5e06
✨ feat(library): every audio stream is a row, and the picked one plays and exports

A file with one audio track per language is one row per track now, not one row
per file. The engine carries the pick end to end: a source is a (file, audio
stream) pair, .edith v3 writes the stream on the source line, playback opens it
and — the trap this closes — the export copies *that* stream's packets rather
than always stream 0.

Streams that cannot go on the timeline are listed greyed with the reason
instead of hidden: a codec we cannot read, or a rate/layout that cannot share
one output device and one copied AAC track with the rest of the timeline (there
is no resampler here and no AAC encoder to write a join with). place_stream_at
is the one door a row goes through, and it refuses those in the engine's own
words.

- v2 and v1 files still load: no stream field means stream 0, which is all
  those dialects could play; saving either writes v3.
- Waveform peaks are keyed by file *and* stream, so two tracks of one file
  cannot draw each other's envelope.
- Library swatches and clip tints follow the *file*, so a file's streams share
  one colour in the panel and on the lanes.
- assets/test_multilang.mp4: two AAC 44.1k stereo streams (und, fra), the shape
  real multi-language media has and the one where a second stream is placeable.
🐛 fix(engine): group ids only where the lanes agree, priming for a leading gapAhmet Kaan Gümüş · 07cd3d3
🐛 fix(engine): group ids only where the lanes agree, priming for a leading gap

Two states the verifier panel reached that saved but would not load
again. `split` and `regroup` handed one fresh id to whichever clip each
lane had at that frame, but the lanes are edited apart: the clip being
cut may start or end somewhere else in the other lane, and a group id
whose two clips disagree about their span is not one take. Each side of
the cut now asks the question separately, so the halves that do line up
stay one take and the ones that do not get ids of their own.

The exported audio of a timeline that opens on a hole played every
sound after the hole 23 ms early: a reader drops the first packet of an
AAC track as priming, and with no packet to spare that drop came out of
the hole. The gap at the head now carries one extra silent packet,
which owes the rounding debt nothing.

Tests: both panel repros, a seeded random-op sweep that reloads the
project after every edit, and the leading-gap onset measured off the
exported file (44032 of an expected 44100; 43008 without the packet).
✨ feat(engine): real silent AAC for export gaps, link + overflow guardsAhmet Kaan Gümüş · 301e29b
✨ feat(engine): real silent AAC for export gaps, link + overflow guards

Grafts the losing candidate's hand-written AAC-LC silence into the
offset-placed lanes: a gap in the audio lane is copied as max_sfb=0
access units (4 bytes mono, 7 stereo, verified against our own decoder)
instead of being spent as stts duration on the packet in front of it.
That retires the 23 ms leading-gap misplacement, so every packet is one
1024-frame sample table entry again and the muxer takes no duration.

from_parts becomes the release-active untrusted door it claims to be:
per-cause errors, an end-overflow bound, and the grouping rules -- a
link id names at most one clip per lane, and a pair covers one span.
The parser bounds the same overflow by line number, `place` strips the
incoming group id, and the two lane surgeries (`clear`, `open_room`)
drop the id from what they cut, which is where duplicates came from.
✨ feat(engine): video+audio lanes with offset-placed clips, gaps, .edith v2Ahmet Kaan Gümüş · 59eb78e
✨ feat(engine): video+audio lanes with offset-placed clips, gaps, .edith v2

Project gains two lanes; a Clip now carries `start` (its timeline
placement) and `link` (group id), so a gap is simply the absence of a
placement rather than an object anyone has to keep in sync. Moves and
trims become arithmetic on start/in_frame; the lane invariant (sorted,
non-overlapping) is checked in from_parts, at the .edith parser, and
asserted after every mutation.

split cuts every lane and hands the two sides fresh group ids; regroup
is its exact inverse. delete still ripples both lanes (the app keeps its
behaviour), lift removes one placement and leaves a hole, place is the
per-lane overwrite that can make one.

A video gap plays as black frames from a worker that opens no file --
same channel, backpressure, cancel and retire path as a decoder -- and
exports as encoded black. An audio gap is synthesised zero chunks, real
ones, so the master clock keeps counting through it; on the export side
it is spent as stts duration on the packet beside it, since there is no
AAC encoder to make silence with.

.edith v2 writes one line per placement per lane; v1 files still load,
as fully-grouped gapless lanes, and save as v2.

2026-08-09

✨ feat(engine): multi-source traversal, import validation, cross-source exportAhmet Kaan Gümüş · 68b0ca2
✨ feat(engine): multi-source traversal, import validation, cross-source export

Wave 2 of the import slice, two packages merged at one seam.

Playback traversal (S3): next_clip/seek open each clip against
project.sources()[clip.source]; audio switches to open_multi_segments over
the (source, start, end) triples segments_from now yields. New
PlaybackSession::import validates dimensions, fps and audio params against
the timeline before appending, and reseeks unconditionally so a running
audio worker learns the appended tail. clip_spans_by_source() added for the
app's per-source tint.

Cross-source export (S4): export::start drops its source path argument --
Project::sources() is the only path truth now -- and is pub so a test can
build a multi-source Project without a session. Each clip opens its own
ClipDecoder; the audio pass carries one bresenham accumulator across source
joins.

Seam: PlaybackSession::path is gone. It was kept only to feed export_to,
which no longer takes a path, so the field and its initialiser go with it.
🐛 fix(export): late-cancel window + atomic .part renameAhmet Kaan Gümüş · f973b71
🐛 fix(export): late-cancel window + atomic .part rename

Cancel was only checked inside the per-clip frame loop, so an esc during
the drain, the audio pass or `finish` completed the export anyway and left
a file the user had asked not to have. Cancel is now checked after the
loop and again before `finish`.

The worker also writes to `<out>.part` and renames it onto the output only
on full success, so the output name never points at a half-written file --
and a killed process orphans a `.part` instead of a playable-looking
`.export.mp4`.
✨ feat(engine): export — edit list to mp4, HW encode with SW fallbackAhmet Kaan Gümüş · 86d5c15
✨ feat(engine): export — edit list to mp4, HW encode with SW fallback

Worker thread per export: decodes each clip straight to I420 (never through
DecodeSession, which only speaks BGRA), feeds one encoder chosen once --
VA-API plugin unless VE_SW_ENC=1 or the plugin is unavailable, rusty_h264
Fast/CBR otherwise -- and muxes the access units as they come. Audio is
copied packet for packet, so the file has to be opened before the first
video sample is written.

Cancel and every error path delete the partial file; progress is a permille
atomic a render loop can read without a lock.

mux: the movie timescale moves to 90 kHz. mp4 0.14 converts each sample
duration into the movie timescale with its own integer division, so 1 kHz
lost 0.33 ms per frame and made a 4.000 s export announce 3.960 s.