Files
punktfunk/include
enricobuehler a81c6ac789 feat(core): a ported de-jitter policy had no way to learn the real frame length
Two independent workstreams hit the same wall: `PUNKTFUNK_AUDIO_FRAME_MS` is the Opus
plane's 5 ms, the lossless plane runs 4 ms at 48/24 and 2 ms at 96/24, and nothing in
the C surface carried the resolved value. An embedder that PORTS the de-jitter policy
rather than draining `next_audio_pcm` — the Apple client does exactly this — was stuck
compiling against 5 ms, which sheds 2.5 frames at a time on a 96 kHz session and puts
the target floor a frame too deep.

The earlier judgement that no C embedder needs this rested on `next_audio_pcm`
reporting each frame's real length in `frame_count`. That is not true in the case that
matters: concealed frames are PREPENDED into the same buffer, so the count answers "how
many samples did I get", not "how long is one frame". The two questions coincide only
when nothing was lost.

Microseconds, not milliseconds — the ladder has sub-millisecond rungs and 2 500 µs must
not truncate to 2 ms. `0` means the host stated nothing, in which case the old constant
is right.

Added, not widened, like the rate and depth accessors before it.
2026-08-16 09:38:16 +02:00
..