forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on fbc29d12fa2e194b105dd2344342fc50da4e90cdFiltered to crates/engine/tests/audio_multi.rsClear filter

2026-09-12

🐛 fix(engine): the multi-audio layout refusal test pins the width refusal that is leftAhmet Kaan Gümüş · 1e84d82
🐛 fix(engine): the multi-audio layout refusal test pins the width refusal that is left

a_source_that_disagrees_on_layout_is_refused still expected stream 1 of the
multi-audio fixture (22.05 kHz mono on a 44.1 kHz stereo timeline) to be
refused outright; d7c614b (DEBT #46) let a mono source up-mix onto a wider
timeline and updated audio_files, playback and saveload, missing this suite.
The test now pins the current posture: the decode path widens and resamples
that stream (drained for contiguity, length and non-silence), the copy path
still refuses it -- copied packets can be neither widened nor resampled and
one esds cannot declare two tracks -- and the refusal left in both paths is
a source wider than the timeline (stereo onto a mono first source), named by
'source 1' in each path's own words.

2026-08-12

✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusingAhmet Kaan Gümüş · c94ba8b
✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusing

An 8-channel Opus track came back "IMPORT FAILED: unsupported channel
layout: 8 channels (max stereo)" and took the picture with it, and a
48 kHz file "audio 48000 Hz 2 ch does not match the timeline's 44100 Hz
2 ch". Both strings are gone: an import converts.

Width: `fold_5_1` becomes `downmix`, a coefficient table per layout from
2.1 to 7.1 (ITU-R BS.775 — front channels keep their side, centre and
surrounds join at -3 dB, LFE dropped, both sides normalised by their own
coefficient sum so a full-scale source cannot clip). 5.1 comes out of the
table bit-identical to what it was. `vorbis_to_film_order` gains the RFC
7845 permutations for 3, 5, 7 and 8 channels beside the 6 it had, so
surround Opus at any width reaches the fold in the order the fold reads.
The AC-3 decoder's own 2.1 passthrough, which it leaves at 3, folds here
too, and a multichannel AAC track in an *mp4* now takes the `rusty_aac`
route the Matroska side already had (`aac_decoder`, one call for both).

Rate: the segment resampler a speeded clip already goes through takes the
source rate over the timeline's into its step, so the two compose into one
interpolation and 48 kHz onto a 44.1 kHz timeline keeps its pitch. All of
it is convert-on-read — per packet in the decoder, per buffer in `emit`,
after the window trim — so there is no upfront pass to show progress for
and nothing to cancel.

What is still refused is the layout alone: a mono track cannot join a
stereo timeline, in the words "audio 1 ch does not match the timeline's
2 ch". The picker's grey-out rule follows the gate rather than leading it.

Measured on a 12.9 GB 2160p AV1 remux with a real-library 7.1 Opus
track: imports, opens as a timeline, and a ten-second WAV export comes
back at RMS 0.0091 left / 0.0085 right.

2026-08-11

🔀 merge(A5): main (de15818) into the import-policy branchAhmet Kaan Gümüş · d17f345
🔀 merge(A5): main (de15818) into the import-policy branch

The rate gate main landed (`Rate`) and this branch's codec gate removal
are the same function: `matches_timeline` keeps main's `Rate` return and
loses the codec equality, with the decoder probe in its place. The
refusal tests that named a rate or a silence now name the one thing
left -- one output device, one rate and one layout.
✨ feat(import): mixed codecs and silent takes join the timelineAhmet Kaan Gümüş · 9bc3bd4
✨ feat(import): mixed codecs and silent takes join the timeline

The two refusals a user hits for no reason are gone: a file coded
differently opens its own decoder like every clip already does, and a
file with no audio track contributes silence over its span like a gap
already does.

What the codec gate was really protecting against stays, moved to the
one place that can answer it: import asks the file for a decoder, so a
machine without the VA-API plugin refuses an HEVC take by the decoder's
own name rather than playing black frames with the complaint on stderr.
Rate and layout stay refused -- there is no resampler.

Both audio paths now read a source with no track as the silence they
already synthesise for a hole: the worker plays it, the packet copy
writes it, so an mp4 export of a timeline with a silent take is as long
as the timeline and quiet where the take is.

2026-08-10

Merge S5a audio-file import into stream-picker mainAhmet Kaan Gümüş · 1bb8ee2
Merge S5a audio-file import into stream-picker main

Both sides taught `audio` a new axis and they meet on one type: S5a made
`Track` an enum over the mp4/AAC reader and symphonia's, main gave every
reader a `(path, stream)` address. The merged `Track::open(path, stream)`
keeps both -- the stream index lives inside `AacTrack::open`, and a
standalone audio file, which has exactly one track by construction, refuses
any stream above 0 rather than quietly serving the only one it has.

- `AudioProbe` is S5a's `{sample_rate, channels}`: equality is playability,
  so an mp3 may share a timeline with mp4s. Copyability is a separate
  refusal, at export, and stays AAC-only through `copy_track`.
- `probe_streams` reads a standalone file through symphonia instead of
  walking it as an mp4 -- an ALAC .m4a parses as an mp4 whose only audio
  track is not AAC, so the mp4 walk would call it undecodable where
  symphonia decodes it.
- Which lane a source lands on is decided once, in `place_stream_at`: a
  file with no picture is placed on the audio lane alone, everything else
  is pasted as a grouped take. The front-end only owes the refusal notice.
- `unsupported()` and the NTSC/VP9 work are untouched; `is_audio` files
  never reach the former, since a song cannot open a timeline at all.
✨ feat(engine): common audio files import and playAhmet Kaan Gümüş · fe53979
✨ feat(engine): common audio files import and play

mp3, wav, flac, ogg-vorbis, ALAC and ADTS join a timeline as sources with
no picture: symphonia's own probe reads them, the audio lane holds them,
and the video lane refuses them by name. The mp4/AAC path is untouched --
it is still the only one that yields packets an export can copy, so a
timeline carrying anything else is refused at export with the file and its
format named rather than exported silent.

A source with no picture is as long as it plays, rounded up to whole
frames; import, load and the library row all derive its length from that.
✨ 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.
✨ 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 model + segmented multi-file audioAhmet Kaan Gümüş · 5593a9f
✨ feat(engine): multi-source model + segmented multi-file audio

Wave 1 of the import slice: the timeline model and the audio backend both
learn about several source files. Nothing user-visible yet — every clip is
still source 0 until playback/export traversal lands.

S1 — project.rs model + mechanical call-site fixes:
- Clip gains `source: usize` (Clip stays Copy, so clipboard/undo semantics
  are untouched); Project gains an append-only `sources: Vec<PathBuf>`.
- Import splits in two: `import(path) -> usize` is dedup-only and pushes no
  history, `append_clip(source_idx, frame_count) -> bool` pushes the one
  snapshot — an import stays exactly one undo step, and append_clip refuses
  an unknown index.
- Dedup key is fs::canonicalize with a raw-path fallback, so Project stays
  pure data and an unreadable path still gets an index.
- cut/paste carry the source through `..self.clips[idx]` struct-update.
- `segments_from` now yields (source, start, end) triples; playback.rs and
  export.rs strip the index and keep feeding the single-source audio fns.

S2 — audio.rs Track/probe/bit-exact joins:
- New private `Track` resolves one source once (reader, copied stts, own
  priming, params, sample_count).
- `open_multi_segments` / `copy_multi_segments` take the source triples;
  `open_segments` / `copy_segments` are now one-source wrappers, so every
  existing call site compiles unchanged.
- Each source contributes its own priming and length; the timeline sample
  counter and the bresenham rounding debt both run continuously across a
  source join, and the extra priming packet stays the first segment's alone.
- `AudioSession::probe(path) -> Option<AudioProbe>` exposes the fields
  import validation needs.
- Cross-source decode is bit-exact against single-file open_at on both
  sides of a join (max abs diff 0e0).