Repository navigation
Conversation
Query availability for a sample range and request background filling at the first gap from a starting sample. Let providers opt out of out-of-order cache filling.
Playback and rendering can read the same cache concurrently. Protect lazy mapping creation and remapping, and keep the mapping stable until the copy finishes. The decoder uses a separate write mapping.
Store whole samples in each fixed-size block so the read and write indexes agree when the sample width does not divide the block size.
Decode and publish 65,536 samples at a time in the RAM cache as well. Keep 4 MiB storage blocks and limit reads to samples already decoded within a block.
Move the sequential worker, decoded-prefix counter, and startup and shutdown code into CacheAudioProvider. Keep the cache read and allocation paths in each backend.
Use the interleaved frame width for cache allocation, indexing, and copies. Use format-aware silence to pad uncached frames. The app factory currently downmixes before caching, while the cache providers can also wrap multichannel sources directly.
Keep storage access in the RAM and disk providers and use one loop to copy decoded samples and pad the unavailable tail.
Give callers an explicit way to request the existing silence fallback on decode errors.
Playback, clip export, waveform and spectrum rendering, and the linear cache retain the silence fallback.
Catch, log, and fill with silence in the tagged overload. Converters and locks let errors reach the outer caller.
Retain the source index and accepted output format so a fresh decoder can reproduce the original sequential read state.
Publish availability per chunk and use it to answer range queries and copy ready samples. Continue filling sequentially.
Expose the worker state separately from the number of samples it published.
Request decode error propagation and leave a failed chunk unpublished. Reset once and replay from the start, discarding samples for ready chunks. Stop the worker if the retry fails.
Follow the latest request to the next gap, continue forward to EOF or a filled region, then fill the earliest gap. Keep linear fill for FFMS2 streams without advancing timestamps.
Compute the audio support of a pixel range, including the full window on each side of the first and last FFT centers in the spectrum.
Check the samples needed for each bitmap, including FFT input, before caching its derived data.
Size the last bitmap to the remaining audio and paint silence beyond the stream end.
Refresh as the total number of ready samples grows and stop polling when the worker finishes.
Use the first visible tile’s required start sample to request a background fill. Repaints at the same position leave the decoder’s current run in progress.
Gate source reads in both cache modes to cover the latest seek, skipping filled chunks, gap backfilling, partially available reads, and sequential-only sources.
Verify that plain reads throw and tagged reads silence partial results. Exercise failed seeks through a converter, linear retry with immutable ready chunks, and a permanent failure in both cache backends.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With audio caching enabled, jumping late in a large video can leave the waveform or spectrum blank while the cache decodes from the beginning. Turning off the cache can make disk reads block the UI.
The RAM and disk cache workers now jump to the first undecoded chunk at or after the requested position. They continue forward until they reach cached audio or the end of the file, then return to earlier gaps. Sources that cannot seek keep decoding sequentially. If a cache read fails, the worker retries sequentially and preserves samples it already published.
The spectrum and waveform draw tiles once their input samples are available. Spectrum requests include the full FFT window around the requested tile. The scrollbar shades uncached regions and shows the active decoder position with a gradient that stops at cache gaps.
The macOS build and all 389 tests passed. Regression coverage exercises seek order, readiness, and decode failures for both cache types. Also checked the live spectrum view with a synthetic file and a slowed cache worker.
🤖 Codex