Commits
Commits on
a2e41540874ce0d04e6fecaf29bd6c8ea161f5442026-08-11
⚡ perf(silence): the card is up on the next frame and reads the film behind itAhmet Kaan Gümüş · a2e4154
⚡ perf(silence): the card is up on the next frame and reads the film behind it Pressing Silence decoded the whole audio track on the render thread -- 51 s of dead window on a 25 GB film, with the card marked open and nothing drawn. The decode is a worker now: the card paints at once and says where the read has got to, out of what the header claims the track is, with the import line's two clocks and its stall wording when the mark stops moving. Closing the card, or opening it on another source, cancels the read at its next chunk; a cancelled scan is never cached, since half a track is not an answer. The levels cache is keyed per source and stream instead of holding the last one only, so two films on a timeline stop paying each other's decode -- A, B, A again is one decode of A. What a scan finds is unchanged: 1393 silences at the shipped defaults on the same film, and the nudges after it lands are the arithmetic they always were.
✨ feat(import): a 25 GB film reads on a worker, and the window says so while it doesAhmet Kaan Gümüş · a2d201d
✨ feat(import): a 25 GB film reads on a worker, and the window says so while it does The freeze was one call: `Demuxer::open` on a cold 29 GB remux is 11 s (measured), and it ran on the UI thread at every import door. Nothing else came close -- the subtitle walk is 200 ms, and the two reads that really are slow (probe_streams 3 s, waveform 55 s) were already off the render thread. So a queued worker reads what the import is about to read and throws it away: the second read costs 150 ms because the pages are warm. The timeline keeps playing through the eleven seconds, and a line above the panel names the file, the stage and an elapsed clock -- and, past five seconds in one stage, says outright that the wait is the file's and not the window's. No percentage anywhere: neither read reports where in the file it has come to, and a bar that invented one would be the lie the freeze already tells. The rest of argv goes through the same door now. Three films on the command line used to be half a minute of no window at all, and a window that has not opened cannot say why.
🐛 fix(zoom): the far stop is the timeline's own length, so a five hour edit has an endAhmet Kaan Gümüş · 69ff17e
🐛 fix(zoom): the far stop is the timeline's own length, so a five hour edit has an end Two 2:30:00 clips are five hours of timeline and the stop was four, so the end of the second one could not be brought on screen by any zoom. The far stop is the whole timeline on the bed plus a sliver now, and short of a pixel to the second (PPS_MIN) the length is not worth widening to -- so a short import still zooms out and the resting scale is still nobody's content. The zoom pill counts hours once there are hours to count.
✨ feat(tonemap): the reference rendition converts a film at the peak the film declaresAhmet Kaan Gümüş · 27097e2
✨ feat(tonemap): the reference rendition converts a film at the peak the film declares `Demuxer::light().peak()` -- a stream's MaxCLL, or its mastering display's maximum -- has been read at every open and dropped on the floor. It now reaches `ToneMapper::new` as `declared_peak`, and `Preset::master_nits_for` is the whole composition rule: `Reference` takes the film's number (1000 stays the fallback for a file that declared nothing), `Standard` and `Vivid` keep their fixed 400 and 250, because a picked exposure that moved per file would not be a pick. One HDR film declares 1759 cd/m^2, so its 1000-nit highlights land at SDR 215 instead of clipping at white, and BT.2408 diffuse white at 145 instead of 166. Both sites that build a table have the demuxer in hand already, so nothing is promoted through `VideoMeta`: the decode funnel reads it before the worker takes the demuxer, and `source_rate` returns it off the header parse export already did -- which is what keeps preview and export on one number. A declared peak is a stranger's number and is checked before it becomes a divisor: outside 100..=10000, or a NaN, is treated as not declared. test_hdr_bright.mkv joins the fixtures for it -- the older HDR metadata ones all say 1000, which no picture can tell apart from the fallback.
✨ feat(demux): a film's real peak brightness is parsed, not assumedAhmet Kaan Gümüş · 5726307
✨ feat(demux): a film's real peak brightness is parsed, not assumed MaxCLL/MaxFALL and the mastering display's luminances, off all three places they live: a Matroska Colour element (0x55BC/0x55BD and the MasteringMetadata floats behind 0x55D0), an mp4 sample entry's clli and mdcv boxes, and -- for the web rips where the container carries none of it -- the HEVC SEI messages of the same names in the first access unit. Carried on Demuxer::light() as ContentLight, whose peak() prefers the measured content light over the display the grade was approved on. Nothing reads it yet: wiring it into the tone map, which today assumes a constant, is its own change.
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for youAhmet Kaan Gümüş · 09671f7
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for you BT.2446 Method A's assumed mastering peak was a constant in the module: 400 cd/m^2, one exposure decided for everybody. It is a matter of taste, not of correctness -- a reference rendition and a vivid one are both honest pictures of the same film -- so it becomes a project setting with three renditions through the very same curve, which is what keeps the hues right whichever is picked: Reference 1000 nits, chroma 1.0 the published conversion (diffuse white 166) Standard 400 nits, chroma 1.0 display-referred, as bright as a player Vivid 250 nits, chroma 1.10 brightest, and a tenth more colour The chroma gain is a scale about 128 in the SDR codes, after the map and clamped to the legal range: a grey stays exactly grey at any gain, and at 1.0 it is a clamp the maths cannot reach, so the other two presets are byte for byte what Method A produced. HLG's OOTF gain is guarded at black -- below a 1000 cd/m^2 peak the system gamma is under 1, and the 0 * inf that follows byte-cast to 0 and put a hole where black belongs. The preset lives on the Project beside the limiter (a setting, not an undo step), reaches the decode workers and the export through the same value, and is saved as a `tonemap` line in edith 11 -- left out when it is the default, so a project holding no HDR media is the bytes it was, and a v10 file loads as the reference rendition, which is the only one it ever had. Picking one rebuilds the picture under the playhead the way a resize does; an SDR project is unmoved. The panel names it beside the resolution and the rate -- the third thing that is the project's rather than the media's -- and a click opens the three renditions with the one in force marked. No stroke: this is a list to look at.
Merge branch 'worktree-agent-a292c399d416157b0'Ahmet Kaan Gümüş · 7744ff1
Merge branch 'worktree-agent-a292c399d416157b0' # Conflicts: # crates/engine/src/export.rs
✨ feat(color): an HDR film reaches the window tone-mapped, and an SDR one is untouchedAhmet Kaan Gümüş · f8dea1c
✨ feat(color): an HDR film reaches the window tone-mapped, and an SDR one is untouched The tone map existed and nothing called it: a PQ or HLG stream was converted with its own matrix and then shown as if its curve were SDR -- flat, grey-washed, half the brightness a player gives it. `Render` now builds one `ToneMapper` per stream (the transfer is a property of the file, and the LUT is float work over 9 537 nodes) and maps the source planes into BT.709 SDR before anything else looks at them, in both branches of the funnel: the fused passthrough conversion and the graded-then-placed one. The grade lands *after* the map, on the one scratch copy the placed path already made -- a look means what it says in the SDR a viewer is shown, not in the ten stops the file was in. An SDR stream takes neither the copy nor the map and is byte for byte the picture it was, asserted against hashes measured before this change (`tonemap_render`). `MASTER_NITS` is 400, not the 1000 an HDR10 grade is mastered to. Told 1000, BT.2446 Method A puts 203-nit diffuse white on code 166, which reads as broadcast-dark; told 400 it lands on 205, which is the brightness mpv shows. The anchor tests carry the recomputed codes rather than wider tolerances, and HLG's OOTF now follows the assumed peak through BT.2100's own log term -- its relative diffuse white is 19% of whatever peak the display has, so it comes out at 170 and no longer agrees with PQ's absolute 203, which is the standard's behaviour and is written down beside the assert. Measured on the real 4K HDR10 film (`hw_decode`, existence-gated): frame 3000 saturation 34.8 -> 98.9, mean luma 107.6 -> 122.2, and 32.5 ms/frame for the map plus the conversion at 3840x1600, inside the 39 ms budget. New fixture `test_pq.mp4`: four flat patches whose codes are written into the planes by hand, so a test names the code it feeds and the code it expects back.
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the gradeAhmet Kaan Gümüş · f390c37
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the grade The export path read a PQ or HLG source's tags, wrote an SDR file and left the pixels on their HDR curve: a washed-out, flat picture in a file that says BT.709. `engine::tonemap` existed and nothing called it. One `ToneMapper` per source stream -- the 9 537-node table is built beside the per-source rate and colour, not per span -- and one call per frame, into the grade scratch the path already owns, ahead of `apply_yuv`. That order is playback's: the grade is a decision made against the SDR picture on the canvas, so applying it to HDR codes would export a picture nobody saw. The matrix remap that used to be the whole of the answer now asks `remap_into`, which knows the tone map hands back BT.709 whatever the source was coded as: an HDR clip is never *also* given the 2020 matrix treatment, and one on a canvas below 720 lines still takes its 709 -> 601 step. An SDR project is byte-identical: no table is built, no branch is taken.
🐛 fix(color): the bitstream says which matrix it is, and a grade happens where the preview grades itAhmet Kaan Gümüş · 86c11d8
🐛 fix(color): the bitstream says which matrix it is, and a grade happens where the preview grades it Two faults the container-level tests could not see. An HEVC export carried its colour in the file's tags and nowhere in the stream, and a decoder reads the stream first: libavcodec inferred "unspecified", which is BT.601, and rendered a 709 export from the wrong matrix (9.78 mean codes off the right render against 2.27 off the wrong one). The vendored encoder now writes a §E.2.1 VUI carrying the colour description, from the same `ColorDescription::output` rule the muxers tag with, so the two halves of a file cannot drift apart. rav1e gets the same signalling for the same reason; `rusty_h264` has no VUI knob at all (`vui_parameters_present_flag` is hardcoded 0), and H.264 only ever ships here inside an mp4 whose `colr` box rescues it. ...and an export remapped a clip into the file's space before grading it, while playback grades in the source's own space and converts for the screen -- so a graded 601 clip on a 709 canvas came out 21.04 mean codes away from the picture the canvas had shown. The grade goes first now, which is the order `Decoded::frame` renders in. Measured, on the frame-0 rig: preview vs export 21.04 -> 0.15, and `ffprobe -show_frames` on the raw HEVC and AV1 elementary streams reads bt709 where it read unknown. An ungraded same-space export is byte-identical to before.
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that oneAhmet Kaan Gümüş · 907dfc5
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that one Exports carried no colour tags at all: the numbers went out as they came off the decoder and every reader downstream had to guess. A 601 clip beside a 709 one went out as two spaces in one file, and nothing said so. Now every export declares a space -- BT.709 at 720 lines and up, BT.601 below, the same rule a reader with no tags applies -- in the Matroska `Colour` element and the mp4 `colr` box, and a clip coded against the other matrix is rewritten into it before it is graded. Same-space clips take the path they always did and not a byte is touched.
✨ feat(colorspace): a picture is converted in the matrix its own file names, not in BT.601Ahmet Kaan Gümüş · 55b1c8d
✨ feat(colorspace): a picture is converted in the matrix its own file names, not in BT.601 Every displayed frame went through one hardcoded integer matrix -- BT.601 limited, 298/409/-100/-208/516 -- whatever the stream said it was. An HD or UHD file read that way shifts: BT.709's red weight is 0.2126 against 0.601's 0.299, which is a visible cast on faces and saturated colour. The two converters now take the `ColorDescription` the demuxers already resolved, and derive their 8.8 coefficients from that matrix's two luma weights and its range once per frame, so the pixel loop is the same multiply-and-shift it was. BT.601 limited rounds to exactly the integers that were hardcoded, so SD material is byte for byte the picture it always was. Stills keep BT.601 on purpose: `rgb_to_i420` writes them in it, and the pair round-trips. Transfer curves are untouched -- a PQ or HLG stream gets the BT.2020 matrix and is still shown as SDR, with the seam marked.
✨ feat(tonemap): PQ and HLG become BT.709 through a published curve, not a guessAhmet Kaan Gümüş · 0a02d34
✨ feat(tonemap): PQ and HLG become BT.709 through a published curve, not a guess BT.2446 Method A, whole: the tone curve, the colour-difference scaling with its luma payback, and BT.2020 -> BT.709 with a simple clip. Written down, so it can be checked against the document instead of against a screenshot. The maths is float and transcendental, so it runs 9537 times per stream -- a 33 x 17 x 17 grid over the input codes -- and the pixel loop is a trilinear interpolation with the two luma neighbours packed into one word. 18.7 ms a 3840x1600 frame, 6.3 ms at 1080p, single core, release. Uneven axes on purpose: 17 luma nodes leave the assumed 1000 cd/m^2 peak five codes shy of SDR white, and a full 33^3 costs 30.7 ms. Above-peak light is clamped before the curve rather than extrapolated through it -- extrapolating sent one channel over the gamut rail and the next under it, a hundred-code hole in a smooth ramp. Standalone: no decoder or export path calls it yet.
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads itAhmet Kaan Gümüş · 070ffe6
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads it Three tiers, per field: the container's own tags (Matroska `Colour`, mp4 `colr`), then the bitstream's (H.264/HEVC SPS VUI, AV1 `color_config`), then the ffmpeg/mpv resolution rule -- 720 lines or taller is BT.709, below it BT.601, limited either way. A code that says nothing, or says something with no implementation here, falls to the next tier rather than answering wrongly. `VideoMeta` carries the answer; nothing consumes it yet. Everything still renders through the hardcoded BT.601 it always did, which is the bug this is the foundation for fixing. The bit-level walks are where this can quietly go wrong: an SPS whose scaling lists are counted wrongly lands the VUI read in the middle of a coefficient. Both are measured -- H.264 and HEVC against hand-built parameter sets (no encoder here writes SPS scaling lists), the rest against fixtures tagged in the container, tagged only in the bitstream, and tagged nowhere, plus the two real films: a 4K HDR remux that reads BT.2020/PQ and a fully untagged 720p one that reads BT.709.
🧹 test(scratch): a fixture directory is deleted by the test that made itAhmet Kaan Gümüş · 5c39124
🧹 test(scratch): a fixture directory is deleted by the test that made it Every suite here made its own directory under /tmp with a name and a process id and then walked away from it: 2907 `ve_*` directories, 6.4G of a 16G tmpfs, none of them reclaimable by anything but a person with `rm`. `engine::scratch::Scratch` is the one place a throwaway path comes from now -- a directory, or the single file inside one -- and `Drop` is what takes it back. That is the whole reason it is a guard rather than a cleanup call at the end of a test: unwinding runs `Drop`, so the *failing* tests, which are exactly the ones that used to leave the most behind, clean up like the passing ones. It derefs to a `Path`, so the call sites did not have to change: the helpers that handed back a `PathBuf` hand back one of these. The prefixes stay what they were, so a directory is still recognisable while a test is stopped in it. Nothing about what a test *does* moved -- only where its fixtures live and when they die. Driven: the whole engine suite and the app's own tests run with the count of `/tmp/ve_*` before equal to the count after.
✨ feat(subtitles): a subtitle row says which film it came out of, and the film is named over its tracksAhmet Kaan Gümüş · ad9f1ba
✨ feat(subtitles): a subtitle row says which film it came out of, and the film is named over its tracks The list was flat and anonymous: eight rows off three files, every one of them "eng" or "und", with the only answer to "whose is this?" hidden in a tooltip. Now a row names its own file in front of the label -- but only where there is more than one file to tell apart, the way an audio row takes "[audio 2]" only where the file gave several -- and wears that file's tint down its left edge, the same colour its clips wear on the lanes and its rows wear in the media list above. The name is cut out of its middle rather than its end. Two episodes off one release are the same words up to the last two characters, and a name truncated from the right is the same row printed twice; `clip_middle` keeps both ends and spends the width it is given, so a wider window spells more of the file out and nothing is capped at a character count somebody guessed. The media list's own names go through it too -- that list had the same collision and nobody had noticed. Where the window is tall enough for it, each file's block is headed by its name and its tint: a label, no click, nothing to fold, so the tracks under it stay the only things to aim at. At the 640x360 floor the list is one row tall, and a header there would name a film and then show none of it -- so `sub_headers_fit` turns them off and the rows go on saying whose they are by themselves. Nothing about the pick moved: a click still sets the flat index into the add-order list, which is what the .edith holds.
Merge branch 'worktree-agent-a62f844d48ad5e2ef' into worktree-agent-a81b5077f25858904Ahmet Kaan Gümüş · d5d7fdfBrowse files
🩹 fix(audio): an mkv's stream 0 is the track it already played, not its firstAhmet Kaan Gümüş · a7dd4c5
🩹 fix(audio): an mkv's stream 0 is the track it already played, not its first A remux flags the language it wants heard with FlagDefault on whichever track it likes -- mkvmerge writes it on the second one all the time -- and every reader here picked with that flag. Numbering the streams by file position outright made stream 0 a different track on those files, so an .edith project saved before the listing existed would quietly start playing the other language. mkv_stream_order puts the track the file already plays first and the rest behind it in file order, and it does not re-derive the old pick, it runs it: the AC-3 arm asks MkvAc3Track the same question Track::open asked it, everything else asks symphonia for its default track. probe_streams, Track::open and therefore the library's rows all count in that one order. Tested on a byte-patched fixture -- ffmpeg writes FlagDefault only to say 0, so the one byte behind the French track's language is flipped to 1 -- and it fails on file-order numbering: eng leads instead of fra.
Merge remote-tracking branch 'origin/main' into worktree-agent-a5df3068013f45edaAhmet Kaan Gümüş · cd8f9faBrowse files
✨ feat(subtitles): the picked track says which film it came out of, wherever it is namedAhmet Kaan Gümüş · a29af89
✨ feat(subtitles): the picked track says which film it came out of, wherever it is named The strip header, the section heading and the toggle's own notice all echoed `track.label` raw: two remuxes' "eng" tracks read alike, and a track whose only tag is "und" named a language nobody speaks. All three now go through one composer over the S1 grouping, so the name a header says and the row a person clicked cannot disagree -- and the strip header wears the file's own colour, the one its library row and its clips already wear. A standalone `.srt` is nobody's stream: no colour, and no stem after a label that is already the file's name. The colour was asked for by a path spelled as it was typed and answered by sources stored symlink-resolved, so `edith assets/film.mkv` painted no colour at all. `file_tint` now falls back to the resolved spelling on a miss, which is also the right answer for a file dragged in by a symlink.
✨ feat(audio): every audio track of an mkv is a row, and the second one playsAhmet Kaan Gümüş · 264c10c
✨ feat(audio): every audio track of an mkv is a row, and the second one plays A Matroska file was worth exactly one audio stream here -- whichever track the readers stumbled on first -- so the second language of a dual-audio remux was invisible and unopenable, and no mkv ever showed what language its sound was in. The header walk now collects every audio TrackEntry in file order with its number, codec id, TrackLanguage and TrackName (demux::matroska_audio_tracks), and that list is what a stream index counts in. The index picks an entry, the entry's *track number* is what each reader is then pointed at -- MkvAudio::open_track for the AC-3 blocks, SymTrack::open_track for symphonia, whose mkv reader keeps the same number as its track id -- so the two readers cannot disagree about which track a stream meant. Stream 0 is still the file's first audio track, sample for sample. Rows name their codec from the container rather than from symphonia's registry: the tracks that most need naming are exactly the ones it has no decoder for, and "opus is not supported" beats "an unsupported format". Fixture: test_multiaudio.mkv, two AAC tracks, eng 440/880 Hz and fra 220/330 Hz -- different tones because a mapping that drifts plays the other language.
✨ feat(subtitles): every track says which film it came out of, and the first import gets a colourAhmet Kaan Gümüş · 388bbf4
✨ feat(subtitles): every track says which film it came out of, and the first import gets a colour SOURCE_TINTS[0] was SURFACE itself, so the first file imported -- the one every session has -- wore the panel's background and had no visible swatch. It is a colour like the other three now, and a test asks for a summed channel distance rather than assert_ne. file_tint's unwrap_or(0) painted any path with no source entry in the first file's colour: a standalone .srt wearing a film it never touched. It answers Option now and the one caller that can miss falls back to the lane's own. subtitle_rows groups the flat add-order list by file, in first-appearance order, numbering each file's tracks the way row_name numbers audio streams. The flat index a click sets and a save writes travels with the row and is never reordered. Nothing draws it yet. lang_human: "und" is what a muxer writes when nobody said, so a row says "unknown language" instead of naming a language nobody speaks.
✨ feat(export): 2K QHD joins the resolution ladderAhmet Kaan Gümüş · 0a39fae
✨ feat(export): 2K QHD joins the resolution ladder 2560x1440 sits between 4K and 1080p in RESOLUTIONS; the ladder, picker rows and stroke-cycle all read the same list, so one rung is the whole change.
🩹 fix(subtitles): the grafts off the losing PGS laneAhmet Kaan Gümüş · bf65371
🩹 fix(subtitles): the grafts off the losing PGS lane - The overlay is a flex box with the canvas as its one growing item, fitted (Contain) the way the picture under it is: size_full inside an absolutely placed box has nothing to be a percentage of, and Fill put every cue somewhere the disc did not. - One way out of subtitle_overlay, and it lets the drawn picture go on the way: the toggle going off leaked an 8 MB atlas tile per press. - A track is pictures because of its codec id, not because its first cue happens to be one: an all-erase or empty PGS track passed for text and an export promised words it has none of. - The sup handed to the decoder stops at the end of the first display set that composes something, so a muxer packing the erase into the same block no longer blanks the cue. - The film-gated session test: the row a click picks, the map a repaint asks for twice (under 16 ms warm), the picture it draws.
🔀 merge(subtitles): a PGS cue is a picture the timeline carriesAhmet Kaan Gümüş · 1bee319
🔀 merge(subtitles): a PGS cue is a picture the timeline carries Conflicts, both in the demux lane's territory: - matroska_subtitles wanted-track filter: PGS joins S_TEXT, and both still skip a track whose ContentEncoding the demuxer cannot undo. - mkv_subtitle_blocks: the demux lane's laced walk stands; A's single-payload read and its refusal of lacing are dropped. A laced block's cues share a start, so end_of's strict > still finds the next real block. - cues_of: A's &mut signature and PGS doc, with the demux lane's unsupported early return that is the source of the refusal text.
✨ feat(demux): a header-stripped or laced Matroska track plays instead of refusingAhmet Kaan Gümüş · 5d028c2
✨ feat(demux): a header-stripped or laced Matroska track plays instead of refusing Two features every disc rip and streaming remux carries and this demuxer had no reader for: - `ContentEncodings`: header stripping (`ContentCompAlgo` 3) puts the bytes the muxer cut off the front of every frame back, and zlib (algo 0) inflates. bzlib, lzo1x, an unknown algorithm and encryption are refused *by name*, and per track -- a film whose sound cannot be read still shows its picture, and a subtitle track that cannot be read is listed with the reason like a bitmap one. - Lacing: all three headers (Xiph, fixed, EBML) read into one `Block` per frame. The frames of a lace get a timestamp each, interpolated across the gap to the block after, because six E-AC-3 frames stacked on one instant is a sound track that walks away from the picture inside a cluster. The two films this was cut for: a BluRay remux whose H.264 track is stripped of one zero byte per block (no picture at all before this), and a WEB remux whose every E-AC-3 block is fixed-laced (no sound at all before this). Both are existence-gated tests beside the hand-built EBML fixtures. zlib is `miniz_oxide`, which `image` already pulls into this build through `png`: no new crate tree and nothing new to compile.
✨ feat(subtitles): a PGS cue is a picture the timeline carries, not a row that says noAhmet Kaan Gümüş · c45b18e
✨ feat(subtitles): a PGS cue is a picture the timeline carries, not a row that says no The four S_HDMV/PGS tracks of a BluRay remux were listed and greyed: pictures, and nothing here could draw one. Now the cue IR carries a picture beside its text -- `Cue::image`, a `CueImage` holding the display set the Matroska block held -- and the rows are rows a click can pick. The decoding is `oxideav-sub-image`: the run-length walk, the palette, the YCbCr and the object fragmentation are not this project's to re-derive. What is written here is the framing between the two -- a Matroska block is a `.sup`'s segments with the `PG` magic and the timestamps taken off, so they go back on -- and the pairing PGS needs and text does not: half the blocks compose nothing, which is the disc clearing the screen, and that is where the cue before them ends. `BlockDuration` is zero on every one of them, so `end_of` now reads a zero the way it reads a missing one. Kept encoded, decoded when something is about to draw it: this film's canvas is 8 MB of RGBA and its four tracks carry eleven thousand display sets, so the IR holds the thirty megabytes the file already spends and the front-end keeps one decoded picture for as long as its cue is up. An export still writes a text track, so a track of pictures writes none and the card says "drawn, not written" before the button. A `.edith` is unchanged: it held a file and a track number and never a cue, which is why a bitmap track round-trips without the format knowing it exists.
🐛 fix(timeline): a dropped row lands where the hand let it go, not after the last clipAhmet Kaan Gümüş · 0d1c2c1
🐛 fix(timeline): a dropped row lands where the hand let it go, not after the last clip
A library row dragged onto the open bed past the last clip was appended to
the end of the timeline wherever it was released: the ghost promised one
frame and the release committed another.
`Project::paste` clamped the frame it was asked for to `timeline_frames()`
-- the clipboard's rule ("put it here", never "here with black in front"),
imposed on every caller of the primitive. A drop names a place on the bed
and means it, and `Project::place` (the audio/further-lane half of the same
drop) already honoured one, so V1 was the odd lane out.
The clamp moves to the clipboard's own door, `PlaybackSession::paste_at`,
and the grouped branch of `place_stream_at` goes to `Project::paste`
directly with the frame the pointer named. Nothing else changes: a paste at
the playhead cannot be past the end anyway.
Pinned by `a_row_dropped_on_the_open_bed_lands_under_the_pointer`, which
walks the release's own chain -- `landing` as `place_frame` composes it,
the frame back through the rate as `insert_source` hands it over, and the
one engine door a row goes through -- and lands frame 300 where it used to
land 150.Merge remote-tracking branch 'origin/main' into worktree-agent-a3fe67eb0bcf4cbceAhmet Kaan Gümüş · 9ebff59Browse files
✨ feat(export): OGG Vorbis is a row you can pick, not a note about missing encodersAhmet Kaan Gümüş · 17d7d99
✨ feat(export): OGG Vorbis is a row you can pick, not a note about missing encoders The export card said "no pure-Rust Vorbis or Opus encoder" and that had stopped being true. `rusty_vorbis` 0.1.1 (Apache-2.0, zero dependencies, same family as the h264/aac/mp3 encoders already here) is the first permissively-licensed pure-Rust Vorbis *encoder*; `oxideav-ogg` 0.1.8 pages it, and its only dependency is the `oxideav-core` the AC-3 decoder already pulls in. No C, no FFI, no new runtime system dependency -- `ldd` on the binary is unchanged, name for name. The row is live, keyed `o`, and names its encoder like every other live row does. VP9 stays refused with the reason it always had: AV1 replaces it. What the bench found, and what the code does about it. Every number below was measured by encoding this suite's own fixtures and decoding them back with symphonia -- an independent decoder, and the one this engine reopens exports with: * The encoder numbers its granules a full block ahead of the samples it codes, so written straight through, every sample lands ~1024 early: a marker signal came back with its head at 36% amplitude and a full-scale burst 1500 samples before the real one, in silence. One hop of silent pre-roll puts it back -- head 0.86 against an input peak of 0.80, the phantom burst down to 0.04. * Its block grid overshoots the last sample, so the stream is padded and the last page's granule declares the timeline's own frame count. An `.ogg` is now exactly as long as the WAV of the same timeline, which is the promise every other audio row here keeps. * Below quality 0.50 the encoder is *quiet*, not merely coarse (1-1.6 dB of level error, near-silence at 0.10), and the whole usable band tops out around 200 kbps. So the file is written at one measured quality, 0.85, and the Sound row is refused by name rather than mapping 128/192/256/320 onto quality steps: the top two are rates this encoder cannot reach, and a card that printed them would be lying. * The embedded setup header is a stereo profile -- a mono push is refused outright -- so a mono mix is written as dual mono, both channels bit-identical. And one defect the round trip turned up on the way in: `SymTrack` subtracted `Track::delay` on top of symphonia, which already drops those frames itself. Every `.mp3` import was losing its first 1105 samples (25 ms) and reading 25 ms short, every `.ogg` its first 128. Measured against `test_tone.flac` -- lossless, and the only one of the three declaring no delay -- which the mp3 and the ogg of the same tone now align with. WAV, FLAC and AAC-in-mp4 read hash-identical across the change; only those two formats move, and both move to the length their own container declares.
🔀 merge(cleanup): the preview and the file read the same cues, and the end stays the end under a sound tweakAhmet Kaan Gümüş · 6b156d8Browse files
🐛 fix(subs+eos): the plate reads the map the file is written from, and a knob past the end leaves the end aloneAhmet Kaan Gümüş · 2bee9c3
🐛 fix(subs+eos): the plate reads the map the file is written from, and a knob past the end leaves the end alone The overlay and the timeline strip drew every subtitle track on the raw timeline clock while the export carried an embedded track through the cuts (export::timeline_cues), so a rippled timeline previewed one thing and wrote another. Both now ask that one map through PlaybackSession::timeline_cues -- preview and file agree by construction, and a standalone .srt keeps the timeline clock it always had. And the end of stream: is_eos promised that "any edit after the end revives the session", which a sound-only edit never did. The transport's own model says it should not -- eos means the picture worker ran out, reseek_audio starts no picture worker, and reviving on an EQ tweak would spend the Ended state that makes the next press restart from the top. The doc now states that rule and a test pins it.
🔀 merge(D2): edits invalidate what they dirty and nothing more — color drags stay audible, the clock anchors on real soundAhmet Kaan Gümüş · 874f762Browse files
Merge remote-tracking branch 'origin/main' into worktree-agent-a70e2dff6f1316489Ahmet Kaan Gümüş · 288629aBrowse files
✨ feat(export): the subtitles leave with the fileAhmet Kaan Gümüş · df92458
✨ feat(export): the subtitles leave with the file A Matroska export now carries the picked subtitle track as S_TEXT/UTF8: a TrackEntry beside the picture and the sound, and one BlockGroup per cue — Block plus BlockDuration, because a SimpleBlock has nowhere to say when a line goes away. Interleaved into the clusters as the AAC packets are, so a player has the cue by the time it needs it. The cues are put on the exported timeline first. A track that came out of a media file is timed against that file, so it is carried through the spans that still play it: a cue over a stretch that was cut out is gone, one straddling the cut keeps the half that is still there, and everything after a rippled delete moves back with the picture it belongs to. A standalone .srt has no clip to hang on and no offset to shift by, so it stays on the timeline's own clock — the one the overlay drew it at — clipped to the exported length. A cue nothing clipped keeps its own microseconds, so an untouched timeline exports the times the source states, to the millisecond the file is written in. An mp4 says so instead of pretending: tx3g is a different beast and nothing here writes one, so the export card carries a Subtitles row that reads "test_subs.srt → embedded", "mkv only — an mp4 carries none" or "none" before the button is pressed. Exports without a picked track are the files they always were: the track entry and the blocks are written only when there is one.
🔀 merge(C6): the frame rate is picked, and the whole edit list conforms to it exactlyAhmet Kaan Gümüş · 3a1b47dBrowse files
✨ feat(rate): the project frame rate is a list to pick fromAhmet Kaan Gümüş · d2e25cc
✨ feat(rate): the project frame rate is a list to pick from The panel could only ever read the rate out. Now it opens the rates the way the resolution button opens the sizes -- 23.976 through 60 with the media's own cycled in and the one in force marked -- and picking one conforms the whole timeline to it. PlaybackSession::set_frame_rate maps every frame number on every lane through one Rate (Project::retime), so a take keeps its seconds, its footage and its sync while being counted on the new grid; every source is re-read through a Rate against it and an export comes out at it. The v9 fps line now governs a video-scaffolded project too, so a project cut at 24 reopens at 24 instead of at the media's 30 with every clip number still counted in 24ths.
🧪 test(playback): the clock counts the sound that played while the picture reopenedAhmet Kaan Gümüş · db1affe
🧪 test(playback): the clock counts the sound that played while the picture reopened seek_keeps_the_audio_clock measured the clock across a window that included next_index -- the wait for the first picture after the seek -- and assumed that wait cost the timeline nothing. It did, before: the clock re-anchored onto an empty ring, so the audio that played during the video decoder's reopen was thrown away and the picture stayed that far behind the sound. Now it is counted, so the assertion is made against the wall clock the window really took (measured: 3.917 s after 0.969 s of real time). The mix card's doc says what a fader now costs, which is nothing.
🔀 merge(E4): the bitrate is typed into a field, not clicked into existence — caret, validation, refusals in wordsAhmet Kaan Gümüş · 79fd658Browse files
✨ feat(export): the custom bitrate is a field you type in, not digits caught from nowhereAhmet Kaan Gümüş · 10cdebc
✨ feat(export): the custom bitrate is a field you type in, not digits caught from nowhere The custom quality row took raw digit keys while the card was open: no caret, no way to see a number before it took effect, no click to focus, and a stray keystroke changed the bitrate with nothing on screen to say it had. It is a field now -- n or a click opens it on the number in force, digits type, backspace edits, ↑↓ step inside 1-20, enter commits and escape gives up -- held as a modal NumberEdit on the player, the way a waiting rebind row is, since nothing in these cards takes gpui focus. Out of range is refused in its own words and keeps what was typed, so a 45 can be fixed to 4 rather than clamped to 20 behind the user's back. The field also says itself on the card's status line, which is outside the scrolling list: at 360 px the custom row can sit below the fold, and a number typed where it cannot be seen is the blind capture this replaces. Digits outside the field now do nothing at all. The sound rate stays a list of presets: the four rates are the legal MPEG-1 Layer III values, so an arbitrary kbps would be snapped by the encoder and the card would name a rate the file does not have.
✨ feat(subtitles): the cues arrive, show over the picture and sit on the timelineAhmet Kaan Gümüş · 863eb63
✨ feat(subtitles): the cues arrive, show over the picture and sit on the timeline Subtitle management, both halves the user asked for: a .srt/.vtt/.ass/.ssa beside the media goes in through the import door it is dropped on, and an mkv opened or imported brings its own text tracks with it — every door (drop, Import, argv, argv extras) picks them up, so a file never arrives with invisible subtitles. The library grows a Subtitles section under the media list: a row per track, its cue count under its name, the picked one marked, and a click picks another — rows rather than a cycle, because four PGS tracks off a remux is an ordinary number. A track that cannot be read is in that list, greyed, saying why in the engine's own words. Over the picture the cue under the playhead is drawn bottom-centred, white on a plate so the film cannot swallow it, one plate per cue so two at once stack and the line breaks the parser kept stay breaks. Under the lanes a thin strip shows where the cues are, through the same Scale every clip box goes through. ToggleSubtitles (t) hides and shows the overlay, from the keyboard, the Actions card or the Subs button beside the snap. No engine change: the doors were complete.
✨ feat(engine): an edit rebuilds what it dirtied, and nothing elseAhmet Kaan Gümüş · c2e62a3
✨ feat(engine): an edit rebuilds what it dirtied, and nothing else Every param change went through one funnel -- edit() -> seek() -- which flushed the audio ring, reopened every track, respawned the feeder and rebuilt the video decoder. Dragging a colour slider therefore cut the sound ~40 times across one gesture, and every restart re-anchored the clock onto an empty ring, so the silence of the restart was counted as timeline time: a permanent A/V offset, re-rolled by every edit made while playing (the resolution-change desync). Edits are classified by what they dirty now. A grade, a fit policy and the project resolution rebuild the picture where it stands and never touch a sample. An equalizer rebuilds the sound and never touches the picture. A fader and the master ceiling rebuild nothing at all: they live at the mix sum, so the running mixer picks them up between two blocks (MixControls), and the limiter is retuned rather than restarted so its delay line -- and the sample count the master clock is made of -- keeps running. Only a structural edit still reseeks both halves. And a restart no longer costs an offset: the feeder stamps the device position its first real sample was queued at, and the clock anchors there instead of on the first poll after the seek, so the silence before the content is never timeline time. Also: a span whose source will not open no longer presents the old channel's frames under the new mapping, and the feeder stops parking 10 ms on a ring that is merely waiting out a flush.
🔀 merge: main (E2's export clocks) into E1Ahmet Kaan Gümüş · 75bfb8e
🔀 merge: main (E2's export clocks) into E1 origin/main had moved past the merge I was pointed at, so the same command was run again. One conflict, the tests' use-list once more: theirs plus `next_audio_kbps` and `audio_rate_choices`. Nothing in E2's progress lines touches the Sound row.