* Fix orphaned queued reads when a freed worker slot is stolen concurrently
ReadOrchestrator.runWorker's finally callback dequeues the oldest queued
read and asserts that createWorker succeeds ("we just freed up a worker").
That assumption races: the callback runs on a later microtask than the
worker's stop, and concurrent read() calls in that gap can LRU-evict the
freed worker and saturate every slot. The assert then throws as an
unhandled rejection after the read was removed from the queue but before
it was attached to any worker - its pending slices' promises never settle
and the awaiting reads hang forever.
Observed in production-like load (a 4-source composition player): 25
back-to-back occurrences saturating both workers, leaving clips
permanently undecodable.
Fix: create the worker first; only dequeue the read once a slot was
actually obtained. If every slot is busy, leave the read queued - each
running worker drains the queue from this same block when it stops, so
the read is picked up by whichever worker stops next.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* Update logic
---------
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Vanilagy <[email protected]>
* Support QuickTime nclc color information
* Tighten QuickTime nclc color test fixture
* Make QuickTime muxer write nclc color box
---------
Co-authored-by: Vanilagy <[email protected]>
* fix: ensure at least one track per type is enabled for Apple ecosystem compatibility
* Add ensureOneEnabledTrack() to ISOBMFF muxer
* Add test case
---------
Co-authored-by: Vanilagy <[email protected]>