Skip to content

v2.3.0

Choose a tag to compare

@github-actions github-actions released this 07 May 15:33
· 88 commits to main since this release
v2.3.0 — shared per-input decoder hub

Each transcoder used to open its own PCMDecoder, so a single Opus
source feeding three auto-mp3 outputs and one opus output ran four
redundant decoders over the same input bytes.

DecoderHub keeps one decoder per input mount. The first transcoder
that wants the input triggers the pump goroutine: subscribe to
input, open decoder, broadcast PCM into an internal Stream named
<inputMount>/_pcm. Every subsequent transcoder for the same input
attaches a SubscribeInternal to that PCM stream, wraps it in a
readerDecoder shim (io.Reader + SampleRate()), and feeds its own
encoder.

Refcount-managed: the last transcoder release brings the pump down,
so the next Acquire pays a fresh decoder warm-up but idle inputs do
not hold one open.

Empirical CPU on the 3-source / 10-encoder configuration:

  v2.2.0 baseline   ~100 %
  v2.2.1            ~50  %
  v2.2.2            ~17  %
  v2.3.0            ~12  %

This is a MINOR bump rather than PATCH because the internal
relay/transcode contract changed (TranscoderManager now owns a
DecoderHub; performTranscode no longer opens PCMDecoders directly).
External API surface — config, HTTP routes, /admin/traffic, etc. —
is unchanged.