mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
Review follow-ups for the apply slice. - Drop the media item transition application. It never supplied a gain the flush had not already supplied, and as a second writer it raced the playback thread: it applied the incoming item's gain while the outgoing item's buffers were still queued, scaling the previous track's tail by the next track's gain (reproduced at +12 dB). The flush is the only writer now. This reverses the earlier decision to keep it as a fallback. That was made on the premise that it was insurance against a flush that could not be resolved. The flush covers every transition, and a period-less flush only happens while the sink is being reset, so the premise does not hold. - Ignore a flush that carries no period rather than reading it as "this item has no gain". Resetting to unity there would have been wrong if a bare flush ever arrived mid-playback; the test that pinned that behaviour now pins the opposite. - Guard the pass-through branch against an empty input, which is the pipeline's own shared buffer and cannot be put into itself. - The controller is written from the playback thread now, so its state updates and the recompute that follows them are synchronized rather than two independent volatile writes. - Add ReplayGainSinkTest, which drives the real DefaultAudioSink and asserts it hands the processor the item being configured. That is the media3 behaviour this whole feature rests on, and it was previously asserted only by comments.